ptychi 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. ptychi-1.0.0/.github/pull_request_template.md +17 -0
  2. ptychi-1.0.0/.github/workflows/pypi_publish.yml +31 -0
  3. ptychi-1.0.0/.github/workflows/python-app.yml +93 -0
  4. ptychi-1.0.0/.gitignore +166 -0
  5. ptychi-1.0.0/LICENSE +184 -0
  6. ptychi-1.0.0/PKG-INFO +84 -0
  7. ptychi-1.0.0/README.rst +61 -0
  8. ptychi-1.0.0/docs/Makefile +19 -0
  9. ptychi-1.0.0/docs/source/api/enums.rst +7 -0
  10. ptychi-1.0.0/docs/source/api/index.rst +10 -0
  11. ptychi-1.0.0/docs/source/api/options.rst +177 -0
  12. ptychi-1.0.0/docs/source/api/task.rst +10 -0
  13. ptychi-1.0.0/docs/source/api/utils.rst +10 -0
  14. ptychi-1.0.0/docs/source/conf.py +28 -0
  15. ptychi-1.0.0/docs/source/getting_started.rst +98 -0
  16. ptychi-1.0.0/docs/source/img/logo.png +0 -0
  17. ptychi-1.0.0/docs/source/index.rst +24 -0
  18. ptychi-1.0.0/docs/source/using_pty_chi/data_structures.rst +63 -0
  19. ptychi-1.0.0/docs/source/using_pty_chi/devices.rst +19 -0
  20. ptychi-1.0.0/docs/source/using_pty_chi/engines.rst +46 -0
  21. ptychi-1.0.0/docs/source/using_pty_chi/index.rst +10 -0
  22. ptychi-1.0.0/docs/source/using_pty_chi/initialization_recommendations.rst +89 -0
  23. ptychi-1.0.0/examples/save_movies.py +133 -0
  24. ptychi-1.0.0/pyproject.toml +54 -0
  25. ptychi-1.0.0/requirements-dev.txt +12 -0
  26. ptychi-1.0.0/setup.cfg +4 -0
  27. ptychi-1.0.0/src/ptychi/__init__.py +16 -0
  28. ptychi-1.0.0/src/ptychi/api/__init__.py +7 -0
  29. ptychi-1.0.0/src/ptychi/api/enums.py +120 -0
  30. ptychi-1.0.0/src/ptychi/api/options/__init__.py +12 -0
  31. ptychi-1.0.0/src/ptychi/api/options/ad_general.py +40 -0
  32. ptychi-1.0.0/src/ptychi/api/options/ad_ptychography.py +104 -0
  33. ptychi-1.0.0/src/ptychi/api/options/base.py +913 -0
  34. ptychi-1.0.0/src/ptychi/api/options/bh.py +71 -0
  35. ptychi-1.0.0/src/ptychi/api/options/data.py +41 -0
  36. ptychi-1.0.0/src/ptychi/api/options/dm.py +63 -0
  37. ptychi-1.0.0/src/ptychi/api/options/lsqml.py +126 -0
  38. ptychi-1.0.0/src/ptychi/api/options/pie.py +84 -0
  39. ptychi-1.0.0/src/ptychi/api/options/plan.py +47 -0
  40. ptychi-1.0.0/src/ptychi/api/options/task.py +36 -0
  41. ptychi-1.0.0/src/ptychi/api/task.py +276 -0
  42. ptychi-1.0.0/src/ptychi/api/types.py +16 -0
  43. ptychi-1.0.0/src/ptychi/data_structures/__init__.py +3 -0
  44. ptychi-1.0.0/src/ptychi/data_structures/base.py +389 -0
  45. ptychi-1.0.0/src/ptychi/data_structures/object.py +780 -0
  46. ptychi-1.0.0/src/ptychi/data_structures/opr_mode_weights.py +323 -0
  47. ptychi-1.0.0/src/ptychi/data_structures/parameter_group.py +48 -0
  48. ptychi-1.0.0/src/ptychi/data_structures/probe.py +577 -0
  49. ptychi-1.0.0/src/ptychi/data_structures/probe_positions.py +190 -0
  50. ptychi-1.0.0/src/ptychi/device.py +35 -0
  51. ptychi-1.0.0/src/ptychi/forward_models.py +817 -0
  52. ptychi-1.0.0/src/ptychi/image_proc.py +1764 -0
  53. ptychi-1.0.0/src/ptychi/io_handles.py +348 -0
  54. ptychi-1.0.0/src/ptychi/maps.py +109 -0
  55. ptychi-1.0.0/src/ptychi/maths.py +565 -0
  56. ptychi-1.0.0/src/ptychi/metrics.py +58 -0
  57. ptychi-1.0.0/src/ptychi/movies/__init__.py +11 -0
  58. ptychi-1.0.0/src/ptychi/movies/api.py +77 -0
  59. ptychi-1.0.0/src/ptychi/movies/io.py +176 -0
  60. ptychi-1.0.0/src/ptychi/movies/mappings.py +62 -0
  61. ptychi-1.0.0/src/ptychi/movies/movie_utils.py +124 -0
  62. ptychi-1.0.0/src/ptychi/movies/settings.py +92 -0
  63. ptychi-1.0.0/src/ptychi/position_correction.py +141 -0
  64. ptychi-1.0.0/src/ptychi/propagate.py +253 -0
  65. ptychi-1.0.0/src/ptychi/py.typed +0 -0
  66. ptychi-1.0.0/src/ptychi/reconstructors/__init__.py +20 -0
  67. ptychi-1.0.0/src/ptychi/reconstructors/ad_general.py +108 -0
  68. ptychi-1.0.0/src/ptychi/reconstructors/ad_ptychography.py +147 -0
  69. ptychi-1.0.0/src/ptychi/reconstructors/base.py +695 -0
  70. ptychi-1.0.0/src/ptychi/reconstructors/bh.py +495 -0
  71. ptychi-1.0.0/src/ptychi/reconstructors/dm.py +361 -0
  72. ptychi-1.0.0/src/ptychi/reconstructors/lsqml.py +1204 -0
  73. ptychi-1.0.0/src/ptychi/reconstructors/nn/__init__.py +9 -0
  74. ptychi-1.0.0/src/ptychi/reconstructors/nn/components.py +27 -0
  75. ptychi-1.0.0/src/ptychi/reconstructors/nn/models/autoencoder.py +174 -0
  76. ptychi-1.0.0/src/ptychi/reconstructors/nn/models/unet.py +182 -0
  77. ptychi-1.0.0/src/ptychi/reconstructors/pie.py +307 -0
  78. ptychi-1.0.0/src/ptychi/timing/io.py +114 -0
  79. ptychi-1.0.0/src/ptychi/timing/timer_utils.py +620 -0
  80. ptychi-1.0.0/src/ptychi/utils.py +470 -0
  81. ptychi-1.0.0/src/ptychi.egg-info/PKG-INFO +84 -0
  82. ptychi-1.0.0/src/ptychi.egg-info/SOURCES.txt +118 -0
  83. ptychi-1.0.0/src/ptychi.egg-info/dependency_links.txt +1 -0
  84. ptychi-1.0.0/src/ptychi.egg-info/requires.txt +15 -0
  85. ptychi-1.0.0/src/ptychi.egg-info/top_level.txt +1 -0
  86. ptychi-1.0.0/tests/conftest.py +43 -0
  87. ptychi-1.0.0/tests/generate_gold_data_for_all.sh +6 -0
  88. ptychi-1.0.0/tests/test_2d_ptycho_affine_pos.py +63 -0
  89. ptychi-1.0.0/tests/test_2d_ptycho_autodiff.py +172 -0
  90. ptychi-1.0.0/tests/test_2d_ptycho_bh.py +175 -0
  91. ptychi-1.0.0/tests/test_2d_ptycho_detector_size.py +93 -0
  92. ptychi-1.0.0/tests/test_2d_ptycho_dip.py +182 -0
  93. ptychi-1.0.0/tests/test_2d_ptycho_dm.py +100 -0
  94. ptychi-1.0.0/tests/test_2d_ptycho_epie.py +59 -0
  95. ptychi-1.0.0/tests/test_2d_ptycho_epie_mixed_states.py +70 -0
  96. ptychi-1.0.0/tests/test_2d_ptycho_epie_opr.py +127 -0
  97. ptychi-1.0.0/tests/test_2d_ptycho_epie_position_correction.py +64 -0
  98. ptychi-1.0.0/tests/test_2d_ptycho_lsqml.py +181 -0
  99. ptychi-1.0.0/tests/test_2d_ptycho_lsqml_compact.py +140 -0
  100. ptychi-1.0.0/tests/test_2d_ptycho_lsqml_momentum.py +58 -0
  101. ptychi-1.0.0/tests/test_2d_ptycho_lsqml_multiscan.py +108 -0
  102. ptychi-1.0.0/tests/test_2d_ptycho_lsqml_uniform.py +62 -0
  103. ptychi-1.0.0/tests/test_2d_ptycho_mpie.py +63 -0
  104. ptychi-1.0.0/tests/test_2d_ptycho_near_field.py +108 -0
  105. ptychi-1.0.0/tests/test_2d_ptycho_opt_plan.py +77 -0
  106. ptychi-1.0.0/tests/test_2d_ptycho_probe_power_constraint.py +133 -0
  107. ptychi-1.0.0/tests/test_2d_ptycho_smoothness_constraint.py +62 -0
  108. ptychi-1.0.0/tests/test_data_on_gpu.py +96 -0
  109. ptychi-1.0.0/tests/test_maths.py +45 -0
  110. ptychi-1.0.0/tests/test_multislice_ptycho_autodiff.py +72 -0
  111. ptychi-1.0.0/tests/test_multislice_ptycho_autodiff_regularized.py +74 -0
  112. ptychi-1.0.0/tests/test_multislice_ptycho_autodiff_slice_spacing_opt.py +76 -0
  113. ptychi-1.0.0/tests/test_multislice_ptycho_lsqml.py +118 -0
  114. ptychi-1.0.0/tests/test_multislice_ptycho_lsqml_joint_step_size.py +64 -0
  115. ptychi-1.0.0/tests/test_multislice_ptycho_lsqml_nonsq_psize.py +74 -0
  116. ptychi-1.0.0/tests/test_multislice_ptycho_lsqml_regularized.py +74 -0
  117. ptychi-1.0.0/tests/test_patch_extraction_placement.py +90 -0
  118. ptychi-1.0.0/tests/test_ptycho_low_mem_forward_model.py +60 -0
  119. ptychi-1.0.0/tests/test_remove_grid_artifacts.py +54 -0
  120. ptychi-1.0.0/tests/test_utils.py +302 -0
@@ -0,0 +1,17 @@
1
+ # Features/fixes
2
+
3
+ Describe new features or bugs fixed.
4
+
5
+ # Related issues (optional)
6
+
7
+ Add links to issues related to this pull request, if any.
8
+
9
+ # Mentions
10
+
11
+ Mention team members responsible for reviewing this change.
12
+
13
+ # Checklist
14
+
15
+ Have you...
16
+ - [ ] Formatted your code properly adhering to PEP-8? Considering using RUFF to format your code automatically.
17
+ - [ ] Merged or rebased the main branch in your branch?
@@ -0,0 +1,31 @@
1
+ name: Upload Python Package to PyPI when a Release is Created
2
+
3
+ on:
4
+ release:
5
+ types: [created]
6
+
7
+ jobs:
8
+ pypi-publish:
9
+ name: Publish release to PyPI
10
+ runs-on: ubuntu-latest
11
+ environment:
12
+ name: pypi
13
+ url: https://pypi.org/p/ptychi
14
+ permissions:
15
+ id-token: write
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v4
20
+ with:
21
+ python-version: "3.x"
22
+ - name: Install dependencies
23
+ run: |
24
+ python -m pip install --upgrade pip build
25
+ - name: Build package
26
+ run: |
27
+ python -m build
28
+ - name: Publish package distributions to PyPI
29
+ uses: pypa/gh-action-pypi-publish@release/v1
30
+ with:
31
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,93 @@
1
+ # This workflow will install Python dependencies, run tests and lint with a single version of Python
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3
+
4
+ name: Python application
5
+
6
+ on:
7
+ push:
8
+ branches: [ "main", "ci" ]
9
+ pull_request:
10
+ branches: [ "main" ]
11
+ workflow_dispatch:
12
+
13
+ env:
14
+ PTYCHO_CI_DATA_DIR: /local/ptycho_aux_data/ci_data
15
+ CONDA_EXE: /local/actions-env/miniconda3/condabin/conda
16
+ CONDA_ROOT: /local/actions-env/miniconda3/
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ lint:
23
+ defaults:
24
+ run:
25
+ shell: bash -l {0}
26
+
27
+ runs-on: self-hosted
28
+
29
+ steps:
30
+ - uses: actions/checkout@v3
31
+
32
+ - name: Activate environment
33
+ id: activate_env
34
+ run: |
35
+ source $CONDA_ROOT/bin/activate ci_py311_base
36
+
37
+ - name: Install Ruff
38
+ run: pip install ruff
39
+
40
+ - name: Run Ruff
41
+ run: ruff check src/ --output-format=github
42
+
43
+ linux-x86-gpu:
44
+
45
+ defaults:
46
+ run:
47
+ shell: bash -l {0}
48
+
49
+ runs-on: self-hosted
50
+
51
+ steps:
52
+ - uses: actions/checkout@v3
53
+
54
+ - name: Update test data
55
+ id: update_test_data
56
+ run: |
57
+ PACKAGE_DIR=$(pwd)
58
+ cd $PTYCHO_CI_DATA_DIR
59
+ git pull origin main
60
+ cd $PACKAGE_DIR
61
+
62
+ - name: Create environment
63
+ id: create_env
64
+ run: |
65
+ export ENVNAME=ci_py311_$(date +%s)
66
+ $CONDA_EXE create --quiet --yes --force -n $ENVNAME --clone ci_py311_base
67
+ echo "ENVNAME=$ENVNAME" >> $GITHUB_ENV
68
+
69
+ - name: Install dependencies
70
+ run: |
71
+ $CONDA_EXE env list
72
+ source $CONDA_ROOT/bin/activate $ENVNAME
73
+ $CONDA_ROOT/envs/$ENVNAME/bin/pip install --upgrade pip
74
+ $CONDA_ROOT/envs/$ENVNAME/bin/pip install pytest
75
+ if [ -f requirements.txt ]; then $CONDA_ROOT/envs/$ENVNAME/bin/pip install -r requirements.txt; fi
76
+ $CONDA_ROOT/envs/$ENVNAME/bin/pip install -e .
77
+ $CONDA_ROOT/envs/$ENVNAME/bin/pip install torch==2.4.1 torchvision==0.19.1 numpy==2.1.2
78
+
79
+ - name: List build environment
80
+ run: $CONDA_EXE list -n $ENVNAME
81
+
82
+ - name: Test with pytest
83
+ run: |
84
+ source $CONDA_ROOT/bin/activate $ENVNAME
85
+ echo $(which python)
86
+ cd tests
87
+ pytest -s --high-tol --save-timing
88
+
89
+ - name: Remove environment
90
+ if: always()
91
+ run: |
92
+ $CONDA_EXE remove -n $ENVNAME --all --yes --force
93
+
@@ -0,0 +1,166 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
105
+ __pypackages__/
106
+
107
+ # Celery stuff
108
+ celerybeat-schedule
109
+ celerybeat.pid
110
+
111
+ # SageMath parsed files
112
+ *.sage.py
113
+
114
+ # Environments
115
+ .env
116
+ .venv
117
+ env/
118
+ venv/
119
+ ENV/
120
+ env.bak/
121
+ venv.bak/
122
+
123
+ # Spyder project settings
124
+ .spyderproject
125
+ .spyproject
126
+
127
+ # Rope project settings
128
+ .ropeproject
129
+
130
+ # mkdocs documentation
131
+ /site
132
+
133
+ # mypy
134
+ .mypy_cache/
135
+ .dmypy.json
136
+ dmypy.json
137
+
138
+ # Pyre type checker
139
+ .pyre/
140
+
141
+ # pytype static type analyzer
142
+ .pytype/
143
+
144
+ # Cython debug symbols
145
+ cython_debug/
146
+
147
+ # Workspace stuff
148
+ workspace/
149
+
150
+ # Binaries
151
+ *.tiff
152
+ *.tif
153
+ *.pdf
154
+ *.date
155
+ *.png
156
+ *.npy
157
+ *.mat
158
+ *.hdf5
159
+ *.h5
160
+
161
+ # PyCharm
162
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
163
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
164
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
165
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
166
+ #.idea/
ptychi-1.0.0/LICENSE ADDED
@@ -0,0 +1,184 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+
4
+ Copyright © 2025 UChicago Argonne, LLC All right reserved
5
+
6
+ Title: Pty-chi: a multi-engine ptychography reconstruction library
7
+
8
+ ARGONNE NATIONAL LABORATORY, WITH A FACILITY IN THE STATE OF ILLINOIS, IS OWNED BY THE UNITED STATES GOVERNMENT, AND OPERATED BY UCHICAGO ARGONNE, LLC UNDER PROVISION OF A CONTRACT WITH THE DEPARTMENT OF ENERGY.
9
+
10
+
11
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
12
+
13
+ 1. Definitions.
14
+
15
+ "License" shall mean the terms and conditions for use, reproduction,
16
+ and distribution as defined by Sections 1 through 9 of this document.
17
+
18
+ "Licensor" shall mean the copyright owner or entity authorized by
19
+ the copyright owner that is granting the License.
20
+
21
+ "Legal Entity" shall mean the union of the acting entity and all
22
+ other entities that control, are controlled by, or are under common
23
+ control with that entity. For the purposes of this definition,
24
+ "control" means (i) the power, direct or indirect, to cause the
25
+ direction or management of such entity, whether by contract or
26
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
27
+ outstanding shares, or (iii) beneficial ownership of such entity.
28
+
29
+ "You" (or "Your") shall mean an individual or Legal Entity
30
+ exercising permissions granted by this License.
31
+
32
+ "Source" form shall mean the preferred form for making modifications,
33
+ including but not limited to software source code, documentation
34
+ source, and configuration files.
35
+
36
+ "Object" form shall mean any form resulting from mechanical
37
+ transformation or translation of a Source form, including but
38
+ not limited to compiled object code, generated documentation,
39
+ and conversions to other media types.
40
+
41
+ "Work" shall mean the work of authorship, whether in Source or
42
+ Object form, made available under the License, as indicated by a
43
+ copyright notice that is included in or attached to the work
44
+ (an example is provided in the Appendix below).
45
+
46
+ "Derivative Works" shall mean any work, whether in Source or Object
47
+ form, that is based on (or derived from) the Work and for which the
48
+ editorial revisions, annotations, elaborations, or other modifications
49
+ represent, as a whole, an original work of authorship. For the purposes
50
+ of this License, Derivative Works shall not include works that remain
51
+ separable from, or merely link (or bind by name) to the interfaces of,
52
+ the Work and Derivative Works thereof.
53
+
54
+ "Contribution" shall mean any work of authorship, including
55
+ the original version of the Work and any modifications or additions
56
+ to that Work or Derivative Works thereof, that is intentionally
57
+ submitted to Licensor for inclusion in the Work by the copyright owner
58
+ or by an individual or Legal Entity authorized to submit on behalf of
59
+ the copyright owner. For the purposes of this definition, "submitted"
60
+ means any form of electronic, verbal, or written communication sent
61
+ to the Licensor or its representatives, including but not limited to
62
+ communication on electronic mailing lists, source code control systems,
63
+ and issue tracking systems that are managed by, or on behalf of, the
64
+ Licensor for the purpose of discussing and improving the Work, but
65
+ excluding communication that is conspicuously marked or otherwise
66
+ designated in writing by the copyright owner as "Not a Contribution."
67
+
68
+ "Contributor" shall mean Licensor and any individual or Legal Entity
69
+ on behalf of whom a Contribution has been received by Licensor and
70
+ subsequently incorporated within the Work.
71
+
72
+ 2. Grant of Copyright License. Subject to the terms and conditions of
73
+ this License, each Contributor hereby grants to You a perpetual,
74
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
75
+ copyright license to reproduce, prepare Derivative Works of,
76
+ publicly display, publicly perform, sublicense, and distribute the
77
+ Work and such Derivative Works in Source or Object form.
78
+
79
+ 3. Grant of Patent License. Subject to the terms and conditions of
80
+ this License, each Contributor hereby grants to You a perpetual,
81
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
82
+ (except as stated in this section) patent license to make, have made,
83
+ use, offer to sell, sell, import, and otherwise transfer the Work,
84
+ where such license applies only to those patent claims licensable
85
+ by such Contributor that are necessarily infringed by their
86
+ Contribution(s) alone or by combination of their Contribution(s)
87
+ with the Work to which such Contribution(s) was submitted. If You
88
+ institute patent litigation against any entity (including a
89
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
90
+ or a Contribution incorporated within the Work constitutes direct
91
+ or contributory patent infringement, then any patent licenses
92
+ granted to You under this License for that Work shall terminate
93
+ as of the date such litigation is filed.
94
+
95
+ 4. Redistribution. You may reproduce and distribute copies of the
96
+ Work or Derivative Works thereof in any medium, with or without
97
+ modifications, and in Source or Object form, provided that You
98
+ meet the following conditions:
99
+
100
+ (a) You must give any other recipients of the Work or
101
+ Derivative Works a copy of this License; and
102
+
103
+ (b) You must cause any modified files to carry prominent notices
104
+ stating that You changed the files; and
105
+
106
+ (c) You must retain, in the Source form of any Derivative Works
107
+ that You distribute, all copyright, patent, trademark, and
108
+ attribution notices from the Source form of the Work,
109
+ excluding those notices that do not pertain to any part of
110
+ the Derivative Works; and
111
+
112
+ (d) If the Work includes a "NOTICE" text file as part of its
113
+ distribution, then any Derivative Works that You distribute must
114
+ include a readable copy of the attribution notices contained
115
+ within such NOTICE file, excluding those notices that do not
116
+ pertain to any part of the Derivative Works, in at least one
117
+ of the following places: within a NOTICE text file distributed
118
+ as part of the Derivative Works; within the Source form or
119
+ documentation, if provided along with the Derivative Works; or,
120
+ within a display generated by the Derivative Works, if and
121
+ wherever such third-party notices normally appear. The contents
122
+ of the NOTICE file are for informational purposes only and
123
+ do not modify the License. You may add Your own attribution
124
+ notices within Derivative Works that You distribute, alongside
125
+ or as an addendum to the NOTICE text from the Work, provided
126
+ that such additional attribution notices cannot be construed
127
+ as modifying the License.
128
+
129
+ You may add Your own copyright statement to Your modifications and
130
+ may provide additional or different license terms and conditions
131
+ for use, reproduction, or distribution of Your modifications, or
132
+ for any such Derivative Works as a whole, provided Your use,
133
+ reproduction, and distribution of the Work otherwise complies with
134
+ the conditions stated in this License.
135
+
136
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
137
+ any Contribution intentionally submitted for inclusion in the Work
138
+ by You to the Licensor shall be under the terms and conditions of
139
+ this License, without any additional terms or conditions.
140
+ Notwithstanding the above, nothing herein shall supersede or modify
141
+ the terms of any separate license agreement you may have executed
142
+ with Licensor regarding such Contributions.
143
+
144
+ 6. Trademarks. This License does not grant permission to use the trade
145
+ names, trademarks, service marks, or product names of the Licensor,
146
+ except as required for reasonable and customary use in describing the
147
+ origin of the Work and reproducing the content of the NOTICE file.
148
+
149
+ 7. Disclaimer of Warranty. Unless required by applicable law or
150
+ agreed to in writing, Licensor provides the Work (and each
151
+ Contributor provides its Contributions) on an "AS IS" BASIS,
152
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
153
+ implied, including, without limitation, any warranties or conditions
154
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
155
+ PARTICULAR PURPOSE. You are solely responsible for determining the
156
+ appropriateness of using or redistributing the Work and assume any
157
+ risks associated with Your exercise of permissions under this License.
158
+
159
+ 8. Limitation of Liability. In no event and under no legal theory,
160
+ whether in tort (including negligence), contract, or otherwise,
161
+ unless required by applicable law (such as deliberate and grossly
162
+ negligent acts) or agreed to in writing, shall any Contributor be
163
+ liable to You for damages, including any direct, indirect, special,
164
+ incidental, or consequential damages of any character arising as a
165
+ result of this License or out of the use or inability to use the
166
+ Work (including but not limited to damages for loss of goodwill,
167
+ work stoppage, computer failure or malfunction, or any and all
168
+ other commercial damages or losses), even if such Contributor
169
+ has been advised of the possibility of such damages.
170
+
171
+ 9. Accepting Warranty or Additional Liability. While redistributing
172
+ the Work or Derivative Works thereof, You may choose to offer,
173
+ and charge a fee for, acceptance of support, warranty, indemnity,
174
+ or other liability obligations and/or rights consistent with this
175
+ License. However, in accepting such obligations, You may act only
176
+ on Your own behalf and on Your sole responsibility, not on behalf
177
+ of any other Contributor, and only if You agree to indemnify,
178
+ defend, and hold each Contributor harmless for any liability
179
+ incurred by, or claims asserted against, such Contributor by reason
180
+ of your accepting any such warranty or additional liability.
181
+
182
+ END OF TERMS AND CONDITIONS
183
+
184
+
ptychi-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,84 @@
1
+ Metadata-Version: 2.4
2
+ Name: ptychi
3
+ Version: 1.0.0
4
+ Summary: Pty-chi is a package of ptychography reconstruction engines
5
+ Requires-Python: >=3.11
6
+ Description-Content-Type: text/x-rst
7
+ License-File: LICENSE
8
+ Requires-Dist: h5py
9
+ Requires-Dist: matplotlib
10
+ Requires-Dist: mypy
11
+ Requires-Dist: numpy
12
+ Requires-Dist: pandas
13
+ Requires-Dist: ruff
14
+ Requires-Dist: scikit-image
15
+ Requires-Dist: scikit-learn
16
+ Requires-Dist: scipy
17
+ Requires-Dist: torch>=2.4.1
18
+ Requires-Dist: torchvision
19
+ Requires-Dist: tqdm
20
+ Provides-Extra: movies
21
+ Requires-Dist: opencv-python; extra == "movies"
22
+ Dynamic: license-file
23
+
24
+ .. image:: docs/source/img/logo.png
25
+ :alt: Pty-chi Logo
26
+ :align: center
27
+ :width: 200px
28
+
29
+
30
+ Welcome to the repository of Pty-chi, a PyTorch-based ptychography reconstruction library!
31
+
32
+
33
+ ============
34
+ Installation
35
+ ============
36
+
37
+ Clone the repository to your workspace, and create a new conda environment
38
+ using::
39
+
40
+ conda create -n ptychi -c conda-forge -c nvidia --file requirements-dev.txt
41
+
42
+ Then install the package using::
43
+
44
+ pip install -e .
45
+
46
+
47
+ =======================
48
+ How to run test scripts
49
+ =======================
50
+
51
+ 1. Contact the developers to be given access to the APS GitLab repository
52
+ that holds test data.
53
+ 2. After gaining access, clone the GitLab data repository to your
54
+ hard drive.
55
+ 3. Set ``PTYCHO_CI_DATA_DIR`` to the ``ci_data`` directory of the data
56
+ repository: ``export PTYCHO_CI_DATA_DIR="path_to_data_repo/ci_data"``.
57
+ 4. Run any test scripts in ``tests`` with Python.
58
+
59
+
60
+ =====================
61
+ How to build the docs
62
+ =====================
63
+
64
+ To build the docs, install the dependencies as the first step::
65
+
66
+ pip install -e .[docs]
67
+
68
+ Then::
69
+
70
+ cd docs
71
+ make html
72
+
73
+ You can then view the docs by opening ``docs/build/html/index.html`` in your browser.
74
+
75
+
76
+ =================
77
+ Developer's Guide
78
+ =================
79
+
80
+ Please refer to the developer's guide for more information on how to contribute
81
+ to the project. The developer's guide is hosted on the
82
+ `Wiki <https://git.aps.anl.gov/ptycho_software/pty-chi/-/wikis/Developer's-guide/home>`_ page of Pty-Chi's
83
+ APS GitLab repository.
84
+ To gain access to the APS GitLab repository, please contact the developers.
@@ -0,0 +1,61 @@
1
+ .. image:: docs/source/img/logo.png
2
+ :alt: Pty-chi Logo
3
+ :align: center
4
+ :width: 200px
5
+
6
+
7
+ Welcome to the repository of Pty-chi, a PyTorch-based ptychography reconstruction library!
8
+
9
+
10
+ ============
11
+ Installation
12
+ ============
13
+
14
+ Clone the repository to your workspace, and create a new conda environment
15
+ using::
16
+
17
+ conda create -n ptychi -c conda-forge -c nvidia --file requirements-dev.txt
18
+
19
+ Then install the package using::
20
+
21
+ pip install -e .
22
+
23
+
24
+ =======================
25
+ How to run test scripts
26
+ =======================
27
+
28
+ 1. Contact the developers to be given access to the APS GitLab repository
29
+ that holds test data.
30
+ 2. After gaining access, clone the GitLab data repository to your
31
+ hard drive.
32
+ 3. Set ``PTYCHO_CI_DATA_DIR`` to the ``ci_data`` directory of the data
33
+ repository: ``export PTYCHO_CI_DATA_DIR="path_to_data_repo/ci_data"``.
34
+ 4. Run any test scripts in ``tests`` with Python.
35
+
36
+
37
+ =====================
38
+ How to build the docs
39
+ =====================
40
+
41
+ To build the docs, install the dependencies as the first step::
42
+
43
+ pip install -e .[docs]
44
+
45
+ Then::
46
+
47
+ cd docs
48
+ make html
49
+
50
+ You can then view the docs by opening ``docs/build/html/index.html`` in your browser.
51
+
52
+
53
+ =================
54
+ Developer's Guide
55
+ =================
56
+
57
+ Please refer to the developer's guide for more information on how to contribute
58
+ to the project. The developer's guide is hosted on the
59
+ `Wiki <https://git.aps.anl.gov/ptycho_software/pty-chi/-/wikis/Developer's-guide/home>`_ page of Pty-Chi's
60
+ APS GitLab repository.
61
+ To gain access to the APS GitLab repository, please contact the developers.
@@ -0,0 +1,19 @@
1
+ # Minimal makefile for Sphinx documentation
2
+
3
+ # You can set these variables from the command line, and also
4
+ # from the environment for the first two.
5
+ SPHINXOPTS ?=
6
+ SPHINXBUILD ?= sphinx-build
7
+ SOURCEDIR = source
8
+ BUILDDIR = build
9
+
10
+ # Put it first so that "make" without argument is like "make help".
11
+ help:
12
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13
+
14
+ .PHONY: help Makefile
15
+
16
+ # Catch-all target: route all unknown targets to Sphinx using the new
17
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
18
+ %: Makefile
19
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,7 @@
1
+ Enumerations
2
+ ============
3
+
4
+ .. automodule:: ptychi.api.enums
5
+ :members:
6
+ :undoc-members:
7
+ :show-inheritance:
@@ -0,0 +1,10 @@
1
+ API Reference
2
+ =============
3
+
4
+ .. toctree::
5
+ :maxdepth: 2
6
+
7
+ options
8
+ enums
9
+ task
10
+ utils