molcrys-kit 0.3.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 (170) hide show
  1. molcrys_kit-0.3.0/.dockerignore +45 -0
  2. molcrys_kit-0.3.0/.gitattributes +1 -0
  3. molcrys_kit-0.3.0/.github/workflows/publish-ghcr.yml +119 -0
  4. molcrys_kit-0.3.0/.github/workflows/publish-pypi.yml +95 -0
  5. molcrys_kit-0.3.0/.github/workflows/unit-tests.yml +33 -0
  6. molcrys_kit-0.3.0/.gitignore +211 -0
  7. molcrys_kit-0.3.0/.pre-commit-config.yaml +20 -0
  8. molcrys_kit-0.3.0/AGENTS.md +236 -0
  9. molcrys_kit-0.3.0/CITATION.cff +34 -0
  10. molcrys_kit-0.3.0/Dockerfile +90 -0
  11. molcrys_kit-0.3.0/Dockerfile.bohrium +33 -0
  12. molcrys_kit-0.3.0/LICENSE +21 -0
  13. molcrys_kit-0.3.0/MANIFEST.in +1 -0
  14. molcrys_kit-0.3.0/PKG-INFO +286 -0
  15. molcrys_kit-0.3.0/README.md +250 -0
  16. molcrys_kit-0.3.0/docs/api_reference.md +44 -0
  17. molcrys_kit-0.3.0/docs/architecture.md +44 -0
  18. molcrys_kit-0.3.0/docs/tutorials.md +334 -0
  19. molcrys_kit-0.3.0/examples/BRCRIM10.cif +113 -0
  20. molcrys_kit-0.3.0/examples/DAI-4.cif +13328 -0
  21. molcrys_kit-0.3.0/examples/DAP-7.cif +3203 -0
  22. molcrys_kit-0.3.0/examples/MAP.cif +94 -0
  23. molcrys_kit-0.3.0/examples/SUXRUA.cif +255 -0
  24. molcrys_kit-0.3.0/molcrys_kit/__init__.py +26 -0
  25. molcrys_kit-0.3.0/molcrys_kit/analysis/__init__.py +44 -0
  26. molcrys_kit-0.3.0/molcrys_kit/analysis/charge.py +183 -0
  27. molcrys_kit-0.3.0/molcrys_kit/analysis/chemical_env.py +1133 -0
  28. molcrys_kit-0.3.0/molcrys_kit/analysis/disorder/__init__.py +9 -0
  29. molcrys_kit-0.3.0/molcrys_kit/analysis/disorder/diagnostics.py +209 -0
  30. molcrys_kit-0.3.0/molcrys_kit/analysis/disorder/edge_priority.py +85 -0
  31. molcrys_kit-0.3.0/molcrys_kit/analysis/disorder/graph.py +1630 -0
  32. molcrys_kit-0.3.0/molcrys_kit/analysis/disorder/info.py +3 -0
  33. molcrys_kit-0.3.0/molcrys_kit/analysis/disorder/process.py +76 -0
  34. molcrys_kit-0.3.0/molcrys_kit/analysis/disorder/solver.py +1607 -0
  35. molcrys_kit-0.3.0/molcrys_kit/analysis/formula_moiety.py +203 -0
  36. molcrys_kit-0.3.0/molcrys_kit/analysis/interactions.py +219 -0
  37. molcrys_kit-0.3.0/molcrys_kit/analysis/packing_shell.py +1061 -0
  38. molcrys_kit-0.3.0/molcrys_kit/analysis/shape.py +733 -0
  39. molcrys_kit-0.3.0/molcrys_kit/analysis/species.py +54 -0
  40. molcrys_kit-0.3.0/molcrys_kit/analysis/stoichiometry.py +156 -0
  41. molcrys_kit-0.3.0/molcrys_kit/constants/__init__.py +261 -0
  42. molcrys_kit-0.3.0/molcrys_kit/constants/atomic_masses.json +120 -0
  43. molcrys_kit-0.3.0/molcrys_kit/constants/atomic_radii.json +98 -0
  44. molcrys_kit-0.3.0/molcrys_kit/constants/config.py +234 -0
  45. molcrys_kit-0.3.0/molcrys_kit/io/__init__.py +11 -0
  46. molcrys_kit-0.3.0/molcrys_kit/io/cif.py +812 -0
  47. molcrys_kit-0.3.0/molcrys_kit/io/output.py +307 -0
  48. molcrys_kit-0.3.0/molcrys_kit/io/xyz.py +59 -0
  49. molcrys_kit-0.3.0/molcrys_kit/operations/__init__.py +69 -0
  50. molcrys_kit-0.3.0/molcrys_kit/operations/builders.py +76 -0
  51. molcrys_kit-0.3.0/molcrys_kit/operations/defects.py +320 -0
  52. molcrys_kit-0.3.0/molcrys_kit/operations/desolvation.py +114 -0
  53. molcrys_kit-0.3.0/molcrys_kit/operations/hydrogen_completion.py +847 -0
  54. molcrys_kit-0.3.0/molcrys_kit/operations/molecule_manipulation.py +603 -0
  55. molcrys_kit-0.3.0/molcrys_kit/operations/perturbation.py +122 -0
  56. molcrys_kit-0.3.0/molcrys_kit/operations/rotation.py +86 -0
  57. molcrys_kit-0.3.0/molcrys_kit/operations/surface.py +1235 -0
  58. molcrys_kit-0.3.0/molcrys_kit/structures/__init__.py +24 -0
  59. molcrys_kit-0.3.0/molcrys_kit/structures/atom.py +68 -0
  60. molcrys_kit-0.3.0/molcrys_kit/structures/crystal.py +419 -0
  61. molcrys_kit-0.3.0/molcrys_kit/structures/molecule.py +410 -0
  62. molcrys_kit-0.3.0/molcrys_kit/structures/polyhedra.py +688 -0
  63. molcrys_kit-0.3.0/molcrys_kit/utils/__init__.py +29 -0
  64. molcrys_kit-0.3.0/molcrys_kit/utils/geometry.py +928 -0
  65. molcrys_kit-0.3.0/molcrys_kit.egg-info/PKG-INFO +286 -0
  66. molcrys_kit-0.3.0/molcrys_kit.egg-info/SOURCES.txt +168 -0
  67. molcrys_kit-0.3.0/molcrys_kit.egg-info/dependency_links.txt +1 -0
  68. molcrys_kit-0.3.0/molcrys_kit.egg-info/requires.txt +16 -0
  69. molcrys_kit-0.3.0/molcrys_kit.egg-info/top_level.txt +1 -0
  70. molcrys_kit-0.3.0/notebook/example/H_lacking_structures/IBPRAC_ibuprofen.cif +96 -0
  71. molcrys_kit-0.3.0/notebook/example/H_lacking_structures/MAP.cif +94 -0
  72. molcrys_kit-0.3.0/notebook/example/disordered_structures/DAN-2.cif +2568 -0
  73. molcrys_kit-0.3.0/notebook/example/disordered_structures/DAP-4.cif +14493 -0
  74. molcrys_kit-0.3.0/notebook/example/disordered_structures/PAP-H4.cif +35166 -0
  75. molcrys_kit-0.3.0/notebook/example/disordered_structures/TILPEN.cif +4450 -0
  76. molcrys_kit-0.3.0/notebook/example/disordered_structures/TILPEN01.cif +12737 -0
  77. molcrys_kit-0.3.0/notebook/example/disordered_structures/TILPEN02.cif +13200 -0
  78. molcrys_kit-0.3.0/notebook/example/disordered_structures/TILPEN03.cif +27364 -0
  79. molcrys_kit-0.3.0/notebook/example/slab-benchmark/PETN_PERYTN10.cif +92 -0
  80. molcrys_kit-0.3.0/notebook/example/slab-benchmark/beta-HMX_OCHTET12.cif +85 -0
  81. molcrys_kit-0.3.0/notebook/molcryskit.ipynb +1004 -0
  82. molcrys_kit-0.3.0/notebook/polyhedra_gallery.ipynb +811 -0
  83. molcrys_kit-0.3.0/paper/README.md +69 -0
  84. molcrys_kit-0.3.0/paper/csd_statistics/README.md +64 -0
  85. molcrys_kit-0.3.0/paper/csd_statistics/csd_statistics.py +322 -0
  86. molcrys_kit-0.3.0/paper/csd_statistics/plot_csd_results.py +221 -0
  87. molcrys_kit-0.3.0/paper/csd_statistics/results/csd_statistics_summary.json +42 -0
  88. molcrys_kit-0.3.0/paper/qm9_benchmark/README.md +69 -0
  89. molcrys_kit-0.3.0/paper/qm9_benchmark/plot_qm9_analysis.py +521 -0
  90. molcrys_kit-0.3.0/paper/qm9_benchmark/results/qm9_real_raw.json +1487 -0
  91. molcrys_kit-0.3.0/paper/qm9_benchmark/results/qm9_statistics.json +76 -0
  92. molcrys_kit-0.3.0/paper/qm9_benchmark/validate_hybridization_qm9_real.py +503 -0
  93. molcrys_kit-0.3.0/paper/slab_benchmark/README.md +58 -0
  94. molcrys_kit-0.3.0/paper/slab_benchmark/bohrium_submit/submit_bohrium.py +167 -0
  95. molcrys_kit-0.3.0/paper/slab_benchmark/multi_system_benchmark.py +457 -0
  96. molcrys_kit-0.3.0/paper/slab_benchmark/plot_benchmark.py +201 -0
  97. molcrys_kit-0.3.0/paper/slab_benchmark/results/multi_system_benchmark.json +333 -0
  98. molcrys_kit-0.3.0/paper/slab_benchmark/slab_examples/Acetaminophen_HXACAN.cif +93 -0
  99. molcrys_kit-0.3.0/paper/slab_benchmark/slab_examples/DAP-M4.cif +133 -0
  100. molcrys_kit-0.3.0/paper/slab_benchmark/slab_examples/beta-HMX_OCHTET12.cif +85 -0
  101. molcrys_kit-0.3.0/pyproject.toml +62 -0
  102. molcrys_kit-0.3.0/requirements.txt +9 -0
  103. molcrys_kit-0.3.0/scripts/diagnose_valence.py +59 -0
  104. molcrys_kit-0.3.0/scripts/docker-test.sh +55 -0
  105. molcrys_kit-0.3.0/scripts/docker_smoke_test.py +192 -0
  106. molcrys_kit-0.3.0/scripts/dump_disorder_modes.py +182 -0
  107. molcrys_kit-0.3.0/scripts/identify_molecules.py +23 -0
  108. molcrys_kit-0.3.0/scripts/process_disordered_structures.py +112 -0
  109. molcrys_kit-0.3.0/scripts/repro_implicit_nh4.py +136 -0
  110. molcrys_kit-0.3.0/scripts/test_defect.py +66 -0
  111. molcrys_kit-0.3.0/scripts/test_desolvation.py +72 -0
  112. molcrys_kit-0.3.0/scripts/test_h_completion.py +67 -0
  113. molcrys_kit-0.3.0/scripts/test_topological_slab.py +170 -0
  114. molcrys_kit-0.3.0/scripts/visualize_disorder_graphs.py +657 -0
  115. molcrys_kit-0.3.0/scripts/visualize_disorder_partialgraphs.py +492 -0
  116. molcrys_kit-0.3.0/setup.cfg +4 -0
  117. molcrys_kit-0.3.0/tests/conftest.py +102 -0
  118. molcrys_kit-0.3.0/tests/data/cif/1-HTP.cif +14996 -0
  119. molcrys_kit-0.3.0/tests/data/cif/Acetaminophen_HXACAN.cif +93 -0
  120. molcrys_kit-0.3.0/tests/data/cif/BRCRIM10.cif +113 -0
  121. molcrys_kit-0.3.0/tests/data/cif/DAC-4.cif +2845 -0
  122. molcrys_kit-0.3.0/tests/data/cif/DACMOR.cif +96 -0
  123. molcrys_kit-0.3.0/tests/data/cif/DAI-4.cif +13328 -0
  124. molcrys_kit-0.3.0/tests/data/cif/DAI-X1.cif +4551 -0
  125. molcrys_kit-0.3.0/tests/data/cif/DAN-2.cif +2568 -0
  126. molcrys_kit-0.3.0/tests/data/cif/DAP-4.cif +14493 -0
  127. molcrys_kit-0.3.0/tests/data/cif/DAP-7.cif +3203 -0
  128. molcrys_kit-0.3.0/tests/data/cif/DAP-O4.cif +7821 -0
  129. molcrys_kit-0.3.0/tests/data/cif/GICVUJ03.cif +128 -0
  130. molcrys_kit-0.3.0/tests/data/cif/ISATIN.cif +77 -0
  131. molcrys_kit-0.3.0/tests/data/cif/MAF-4.cif +322 -0
  132. molcrys_kit-0.3.0/tests/data/cif/MAP.cif +94 -0
  133. molcrys_kit-0.3.0/tests/data/cif/NatComm-1.cif +6115 -0
  134. molcrys_kit-0.3.0/tests/data/cif/PAP-4.cif +4612 -0
  135. molcrys_kit-0.3.0/tests/data/cif/PAP-H4.cif +35166 -0
  136. molcrys_kit-0.3.0/tests/data/cif/PAP-M5.cif +4230 -0
  137. molcrys_kit-0.3.0/tests/data/cif/PETN_PERYTN10.cif +92 -0
  138. molcrys_kit-0.3.0/tests/data/cif/SUXRUA.cif +255 -0
  139. molcrys_kit-0.3.0/tests/data/cif/TILPEN.cif +4450 -0
  140. molcrys_kit-0.3.0/tests/data/cif/ZIF-4.cif +571 -0
  141. molcrys_kit-0.3.0/tests/data/cif/ZIF-8.cif +358 -0
  142. molcrys_kit-0.3.0/tests/data/cif/ammonium_sp_explicit_hm4.cif +3707 -0
  143. molcrys_kit-0.3.0/tests/data/cif/anhydrousCaffeine2_CGD_2007_7_1406.cif +367 -0
  144. molcrys_kit-0.3.0/tests/data/cif/anhydrousCaffeine_CGD_2007_7_1406.cif +544 -0
  145. molcrys_kit-0.3.0/tests/data/cif/phenethylammonium_sp_p21m.cif +3250 -0
  146. molcrys_kit-0.3.0/tests/data/test_full_coords.cif +183 -0
  147. molcrys_kit-0.3.0/tests/dev/test_phase1_io.py +144 -0
  148. molcrys_kit-0.3.0/tests/test_cif_parsing.py +121 -0
  149. molcrys_kit-0.3.0/tests/unit/README.md +29 -0
  150. molcrys_kit-0.3.0/tests/unit/test_analysis.py +389 -0
  151. molcrys_kit-0.3.0/tests/unit/test_constants.py +114 -0
  152. molcrys_kit-0.3.0/tests/unit/test_disorder.py +328 -0
  153. molcrys_kit-0.3.0/tests/unit/test_disorder_regression.py +717 -0
  154. molcrys_kit-0.3.0/tests/unit/test_disorder_repair.py +75 -0
  155. molcrys_kit-0.3.0/tests/unit/test_formula_moiety.py +81 -0
  156. molcrys_kit-0.3.0/tests/unit/test_geometry.py +365 -0
  157. molcrys_kit-0.3.0/tests/unit/test_hydrogen_completion_regression.py +287 -0
  158. molcrys_kit-0.3.0/tests/unit/test_io_cif.py +218 -0
  159. molcrys_kit-0.3.0/tests/unit/test_io_output.py +124 -0
  160. molcrys_kit-0.3.0/tests/unit/test_molecule_manipulation.py +566 -0
  161. molcrys_kit-0.3.0/tests/unit/test_operations.py +320 -0
  162. molcrys_kit-0.3.0/tests/unit/test_packing_shell.py +810 -0
  163. molcrys_kit-0.3.0/tests/unit/test_polyhedra.py +382 -0
  164. molcrys_kit-0.3.0/tests/unit/test_shape.py +208 -0
  165. molcrys_kit-0.3.0/tests/unit/test_slab_terminations.py +406 -0
  166. molcrys_kit-0.3.0/tests/unit/test_sp_completion.py +56 -0
  167. molcrys_kit-0.3.0/tests/unit/test_special_positions.py +158 -0
  168. molcrys_kit-0.3.0/tests/unit/test_structures.py +240 -0
  169. molcrys_kit-0.3.0/tests/unit/test_topological_slab_script.py +0 -0
  170. molcrys_kit-0.3.0/tests/unit/test_unwrap.py +65 -0
@@ -0,0 +1,45 @@
1
+ # .dockerignore — keep the build context lean
2
+ # The local build still sends a context to Docker, even though the main Dockerfile
3
+ # installs the package and extracts notebooks/scripts from the GitHub archive.
4
+
5
+ # Python build artefacts
6
+ __pycache__/
7
+ *.py[cod]
8
+ *.pyo
9
+ *.pyd
10
+ *.egg-info/
11
+ *.egg
12
+ dist/
13
+ build/
14
+ .eggs/
15
+ .installed.cfg
16
+ MANIFEST
17
+
18
+ # Coverage / test outputs
19
+ .coverage
20
+ htmlcov/
21
+ .pytest_cache/
22
+ output/
23
+
24
+ # Jupyter artefacts
25
+ .ipynb_checkpoints/
26
+ # NOTE: do NOT exclude *.ipynb here. The current Dockerfile downloads the
27
+ # notebook/ tree from the GitHub archive rather than COPY'ing it from the local
28
+ # context, but keeping notebooks in the context avoids future surprises if the
29
+ # build strategy changes again.
30
+
31
+ # Editor / OS
32
+ .vscode/
33
+ .idea/
34
+ *.swp
35
+ *.swo
36
+ .DS_Store
37
+ Thumbs.db
38
+
39
+ # Git
40
+ .git/
41
+ .gitignore
42
+
43
+ # Docs / CI (not needed in the image)
44
+ docs/
45
+ benchmarks/
@@ -0,0 +1 @@
1
+ *.ipynb linguist-generated=true
@@ -0,0 +1,119 @@
1
+ name: publish-ghcr
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+ inputs:
9
+ git_ref:
10
+ description: "GitHub archive ref to build from (for example refs/heads/main or refs/tags/v0.2.0)"
11
+ required: true
12
+ default: "refs/heads/main"
13
+ type: string
14
+ image_tag:
15
+ description: "GHCR image tag to push (for example dev260326 or v0.2.0)"
16
+ required: true
17
+ default: "dev"
18
+ type: string
19
+
20
+ permissions:
21
+ contents: read
22
+ packages: write
23
+
24
+ jobs:
25
+ publish:
26
+ runs-on: ubuntu-latest
27
+
28
+ steps:
29
+ - name: Check out repository
30
+ uses: actions/checkout@v4
31
+ with:
32
+ fetch-depth: 0
33
+
34
+ - name: Resolve build ref and output image coordinates
35
+ id: prep
36
+ shell: bash
37
+ run: |
38
+ set -euo pipefail
39
+
40
+ OWNER_LC="$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')"
41
+ IMAGE="ghcr.io/${OWNER_LC}/molcryskit"
42
+
43
+ if [[ "${GITHUB_EVENT_NAME}" == "push" && "${GITHUB_REF}" == refs/tags/* ]]; then
44
+ GIT_REF="refs/tags/${GITHUB_REF_NAME}"
45
+ IMAGE_TAG="${GITHUB_REF_NAME}"
46
+ else
47
+ GIT_REF="${{ github.event.inputs.git_ref }}"
48
+ IMAGE_TAG="${{ github.event.inputs.image_tag }}"
49
+ fi
50
+
51
+ if [[ "${GIT_REF}" != refs/heads/* && "${GIT_REF}" != refs/tags/* ]]; then
52
+ echo "git_ref must start with refs/heads/ or refs/tags/: ${GIT_REF}" >&2
53
+ exit 1
54
+ fi
55
+
56
+ if [[ ! "${IMAGE_TAG}" =~ ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$ ]]; then
57
+ echo "image_tag is not a valid Docker tag: ${IMAGE_TAG}" >&2
58
+ exit 1
59
+ fi
60
+
61
+ PROMOTE_LATEST="false"
62
+ if [[ "${GITHUB_EVENT_NAME}" == "push" && "${GITHUB_REF}" == refs/tags/* && "${GITHUB_REF_NAME}" != *-* ]]; then
63
+ PROMOTE_LATEST="true"
64
+ fi
65
+
66
+ echo "image=${IMAGE}" >> "${GITHUB_OUTPUT}"
67
+ echo "git_ref=${GIT_REF}" >> "${GITHUB_OUTPUT}"
68
+ echo "image_tag=${IMAGE_TAG}" >> "${GITHUB_OUTPUT}"
69
+ echo "promote_latest=${PROMOTE_LATEST}" >> "${GITHUB_OUTPUT}"
70
+
71
+ - name: Log in to GHCR
72
+ uses: docker/login-action@v3
73
+ with:
74
+ registry: ghcr.io
75
+ username: ${{ github.actor }}
76
+ password: ${{ secrets.GITHUB_TOKEN }}
77
+
78
+ - name: Generate image metadata
79
+ id: meta
80
+ uses: docker/metadata-action@v5
81
+ with:
82
+ images: ${{ steps.prep.outputs.image }}
83
+ tags: |
84
+ type=raw,value=${{ steps.prep.outputs.image_tag }}
85
+ type=sha,prefix=sha-
86
+ type=raw,value=latest,enable=${{ steps.prep.outputs.promote_latest == 'true' }}
87
+ labels: |
88
+ org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
89
+ org.opencontainers.image.revision=${{ github.sha }}
90
+ org.opencontainers.image.version=${{ steps.prep.outputs.image_tag }}
91
+
92
+ - name: Set up Docker Buildx
93
+ uses: docker/setup-buildx-action@v3
94
+
95
+ - name: Build and push image
96
+ id: build
97
+ uses: docker/build-push-action@v6
98
+ with:
99
+ context: .
100
+ file: ./Dockerfile
101
+ push: true
102
+ build-args: |
103
+ MOLCRYSKIT_REF=${{ steps.prep.outputs.git_ref }}
104
+ tags: ${{ steps.meta.outputs.tags }}
105
+ labels: ${{ steps.meta.outputs.labels }}
106
+ cache-from: type=gha
107
+ cache-to: type=gha,mode=max
108
+
109
+ - name: Write publish summary
110
+ shell: bash
111
+ run: |
112
+ {
113
+ echo "## GHCR publish result"
114
+ echo
115
+ echo "- Image: \`${{ steps.prep.outputs.image }}\`"
116
+ echo "- Git ref inside build: \`${{ steps.prep.outputs.git_ref }}\`"
117
+ echo "- Primary tag: \`${{ steps.prep.outputs.image_tag }}\`"
118
+ echo "- Digest: \`${{ steps.build.outputs.digest }}\`"
119
+ } >> "${GITHUB_STEP_SUMMARY}"
@@ -0,0 +1,95 @@
1
+ name: publish-pypi
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+ inputs:
9
+ target:
10
+ description: "Package index to publish to"
11
+ required: true
12
+ default: "testpypi"
13
+ type: choice
14
+ options:
15
+ - testpypi
16
+ - pypi
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ build:
23
+ runs-on: ubuntu-latest
24
+
25
+ steps:
26
+ - name: Check out repository
27
+ uses: actions/checkout@v4
28
+
29
+ - name: Set up Python
30
+ uses: actions/setup-python@v5
31
+ with:
32
+ python-version: "3.10"
33
+ cache: pip
34
+
35
+ - name: Install build frontend
36
+ run: |
37
+ python -m pip install --upgrade pip
38
+ python -m pip install build
39
+
40
+ - name: Build source and wheel distributions
41
+ run: python -m build
42
+
43
+ - name: Upload distributions
44
+ uses: actions/upload-artifact@v4
45
+ with:
46
+ name: python-package-distributions
47
+ path: dist/
48
+ if-no-files-found: error
49
+
50
+ publish-testpypi:
51
+ needs: build
52
+ runs-on: ubuntu-latest
53
+ if: github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'testpypi'
54
+ environment:
55
+ name: testpypi
56
+ url: https://test.pypi.org/project/molcrys-kit/
57
+ permissions:
58
+ contents: read
59
+ id-token: write
60
+
61
+ steps:
62
+ - name: Download distributions
63
+ uses: actions/download-artifact@v4
64
+ with:
65
+ name: python-package-distributions
66
+ path: dist/
67
+
68
+ - name: Publish to TestPyPI
69
+ uses: pypa/gh-action-pypi-publish@release/v1
70
+ with:
71
+ repository-url: https://test.pypi.org/legacy/
72
+ packages-dir: dist/
73
+
74
+ publish-pypi:
75
+ needs: build
76
+ runs-on: ubuntu-latest
77
+ if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'pypi')
78
+ environment:
79
+ name: pypi
80
+ url: https://pypi.org/project/molcrys-kit/
81
+ permissions:
82
+ contents: read
83
+ id-token: write
84
+
85
+ steps:
86
+ - name: Download distributions
87
+ uses: actions/download-artifact@v4
88
+ with:
89
+ name: python-package-distributions
90
+ path: dist/
91
+
92
+ - name: Publish to PyPI
93
+ uses: pypa/gh-action-pypi-publish@release/v1
94
+ with:
95
+ packages-dir: dist/
@@ -0,0 +1,33 @@
1
+ name: unit-tests
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ branches:
7
+ - main
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ unit-tests:
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - name: Check out repository
19
+ uses: actions/checkout@v4
20
+
21
+ - name: Set up Python
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.10"
25
+ cache: pip
26
+
27
+ - name: Install test dependencies
28
+ run: |
29
+ python -m pip install --upgrade pip
30
+ python -m pip install -e ".[test]"
31
+
32
+ - name: Run unit tests
33
+ run: pytest tests/unit
@@ -0,0 +1,211 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.pyc
4
+ *.py[codz]
5
+ *$py.class
6
+
7
+ # C extensions
8
+ *.so
9
+
10
+ # Distribution / packaging
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py.cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # UV
99
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ #uv.lock
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ #poetry.lock
110
+ #poetry.toml
111
+
112
+ # pdm
113
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
115
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
116
+ #pdm.lock
117
+ #pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # pixi
122
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
123
+ #pixi.lock
124
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
125
+ # in the .venv directory. It is recommended not to include this directory in version control.
126
+ .pixi
127
+
128
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
129
+ __pypackages__/
130
+
131
+ # Celery stuff
132
+ celerybeat-schedule
133
+ celerybeat.pid
134
+
135
+ # SageMath parsed files
136
+ *.sage.py
137
+
138
+ # Environments
139
+ .env
140
+ .envrc
141
+ .venv
142
+ env/
143
+ venv/
144
+ ENV/
145
+ env.bak/
146
+ venv.bak/
147
+
148
+ # Spyder project settings
149
+ .spyderproject
150
+ .spyproject
151
+
152
+ # Rope project settings
153
+ .ropeproject
154
+
155
+ # mkdocs documentation
156
+ /site
157
+
158
+ # mypy
159
+ .mypy_cache/
160
+ .dmypy.json
161
+ dmypy.json
162
+
163
+ # Pyre type checker
164
+ .pyre/
165
+
166
+ # pytype static type analyzer
167
+ .pytype/
168
+
169
+ # Cython debug symbols
170
+ cython_debug/
171
+
172
+ # PyCharm
173
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
174
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
175
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
176
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
177
+ #.idea/
178
+
179
+ # Abstra
180
+ # Abstra is an AI-powered process automation framework.
181
+ # Ignore directories containing user credentials, local state, and settings.
182
+ # Learn more at https://abstra.io/docs
183
+ .abstra/
184
+
185
+ # Visual Studio Code
186
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
187
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
188
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
189
+ # you could uncomment the following to ignore the entire vscode folder
190
+ # .vscode/
191
+
192
+ # Ruff stuff:
193
+ .ruff_cache/
194
+
195
+ # PyPI configuration file
196
+ .pypirc
197
+
198
+ # Cursor
199
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
200
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
201
+ # refer to https://docs.cursor.com/context/ignore-files
202
+ .cursorignore
203
+ .cursorindexingignore
204
+
205
+ # Marimo
206
+ marimo/_static/
207
+ marimo/_lsp/
208
+ __marimo__/
209
+
210
+ # Local planning notes (scratch only; not part of the published source)
211
+ plans/
@@ -0,0 +1,20 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.4.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ - id: check-added-large-files
9
+
10
+ - repo: https://github.com/astral-sh/ruff-pre-commit
11
+ rev: v0.1.6
12
+ hooks:
13
+ - id: ruff
14
+ args: [--fix, --exit-non-zero-on-fix]
15
+ - id: ruff-format
16
+
17
+ - repo: https://github.com/kynan/nbstripout
18
+ rev: 0.6.1
19
+ hooks:
20
+ - id: nbstripout