Skip to content

Commit

Permalink
Merge pull request #167 from pycroscopy/use_dict3
Browse files Browse the repository at this point in the history
python 13 support for pypi
  • Loading branch information
gduscher authored Sep 1, 2024
2 parents 7542ffa + 0c6299d commit f5f0c04
Show file tree
Hide file tree
Showing 10 changed files with 1,008 additions and 683 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: build

env:
PYTHON_MAIN_VERSION: 3.9

PYTHON_MAIN_VERSION: 3.12

on:
pull_request:
Expand All @@ -19,7 +20,8 @@ jobs:
strategy:
max-parallel: 5
matrix:
python-version: ['3.9', '3.11', '3.12']

python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -73,6 +75,6 @@ jobs:
env:
PYPI_TOKEN_PASSWORD: ${{ secrets.API_TOKEN_PYPI2 }}
run: |
pip install wheel twine
python setup.py sdist bdist_wheel
pip install wheel twine, build
python -m build --sdist --wheel
twine upload --username "__token__" --password $PYPI_TOKEN_PASSWORD dist/*
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,5 @@ _autosummary/pyTEMlib.version.rst
_autosummary/pyTEMlib.xrpa_x_sections.rst
notebooks/Imaging/Adaptive_Fourier_Filter-Copy1.ipynb
notebooks/Spectroscopy/EELS_286.hf5
notebooks/Spectroscopy/Untitled1.ipynb
pyTEMlib/info_widget2.py
342 changes: 318 additions & 24 deletions notebooks/Imaging/Adaptive_Fourier_Filter.ipynb

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions notebooks/Spectroscopy/Analyse_Low_Loss.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"output_type": "stream",
"text": [
"installing pyTEMlib\n",
"^C\n",
"done\n"
]
}
Expand Down Expand Up @@ -134,7 +135,7 @@
"You don't have gwyfile installed. If you wish to open .gwy files, you will need to install it (pip install gwyfile) before attempting.\n",
"Symmetry functions of spglib enabled\n",
"Using kinematic_scattering library version {_version_ } by G.Duscher\n",
"pyTEM version: 0.2024.05.0\n"
"pyTEM version: 0.2024.06.1\n"
]
}
],
Expand Down Expand Up @@ -184,18 +185,17 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {
"hideCode": false,
"hidePrompt": false,
"scrolled": true,
"tags": []
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e97659f2b3e241258b41f43e7407140b",
"model_id": "1df15f0809c94ee9b9e68b66143a2f9a",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -3400,7 +3400,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"version": "3.11.9"
},
"toc": {
"base_numbering": "3",
Expand Down
729 changes: 307 additions & 422 deletions notebooks/Spectroscopy/EDS.ipynb

Large diffs are not rendered by default.

385 changes: 218 additions & 167 deletions pyTEMlib/eds_tools.py

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions pyTEMlib/image_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,12 @@ def rigid_registration(dataset, sub_pixel=True):
rig_reg, drift = rig_reg_drift(dataset, relative_drift)
crop_reg, input_crop = crop_image_stack(rig_reg, drift)

rigid_registered = dataset.like_data(crop_reg)
rigid_registered.title = 'Rigid Registration'
rigid_registered = sidpy.Dataset.from_array(crop_reg,
title='Rigid Registration',
data_type='IMAGE_STACK',
quantity=dataset.quantity,
units=dataset.units)
rigid_registered.title = 'Rigid_Registration'
rigid_registered.source = dataset.title
rigid_registered.metadata = {'analysis': 'rigid sub-pixel registration', 'drift': drift,
'input_crop': input_crop, 'input_shape': dataset.shape[1:]}
Expand Down Expand Up @@ -664,9 +668,9 @@ def rig_reg_drift(dset, rel_drift):
# absolute drift
print(rel_drift)
drift = np.array(rel_drift).copy()

drift[0] = [0, 0]
for i in range(drift.shape[0]):
for i in range(1, drift.shape[0]):
drift[i] = drift[i - 1] + rel_drift[i]
center_drift = drift[int(drift.shape[0] / 2)]
drift = drift - center_drift
Expand Down
4 changes: 2 additions & 2 deletions pyTEMlib/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
version
"""
_version = '0.2024.06.0'
_version = '0.2024.08.4'
__version__ = _version
_time = '2024-06-10 19:58:26'
_time = '2024-08-28 19:58:26'
194 changes: 140 additions & 54 deletions pyTEMlib/xrpa_x_sections.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import os
import setuptools


here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst')) as f:
long_description = f.read()
Expand Down Expand Up @@ -47,7 +48,7 @@
author="Gerd Duscher",
author_email="[email protected]",

install_requires=['scipy', 'numpy', 'pillow', 'ase', 'tqdm', 'plotly', 'pandas', 'requests', 'lxml', 'ipympl',
install_requires=['scipy', 'numpy', 'pillow', 'ase', 'tqdm', 'plotly', 'pandas', 'requests', 'lxml', 'ipympl', 'build',
'spglib', 'scikit-image', 'scikit-learn', 'pyNSID>=0.0.7', 'sidpy>=0.12.1', 'SciFiReaders>=0.0.8'], # 'PyQt5> 1.0'],#
setup_requires=['pytest-runner'],
tests_require=['pytest'],
Expand Down

0 comments on commit f5f0c04

Please sign in to comment.