cryojax 0.2.2__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.
- cryojax-0.2.2/.gitattributes +4 -0
- cryojax-0.2.2/.github/dependabot.yml +6 -0
- cryojax-0.2.2/.github/workflows/build_docs.yml +45 -0
- cryojax-0.2.2/.github/workflows/release.yml +36 -0
- cryojax-0.2.2/.github/workflows/ruff.yml +12 -0
- cryojax-0.2.2/.github/workflows/testing.yml +43 -0
- cryojax-0.2.2/.gitignore +10 -0
- cryojax-0.2.2/.pre-commit-config.yaml +24 -0
- cryojax-0.2.2/CONTRIBUTING.md +39 -0
- cryojax-0.2.2/LICENSE +504 -0
- cryojax-0.2.2/PKG-INFO +671 -0
- cryojax-0.2.2/README.md +136 -0
- cryojax-0.2.2/docs/_static/custom_css.css +153 -0
- cryojax-0.2.2/docs/_static/mathjax.js +21 -0
- cryojax-0.2.2/docs/api/simulator/scattering_potential.md +95 -0
- cryojax-0.2.2/docs/examples/data/.gitkeep +0 -0
- cryojax-0.2.2/docs/examples/data/ribosome_4ug0_micrograph.mrc +3 -0
- cryojax-0.2.2/docs/examples/data/ribosome_4ug0_micrograph.mrcs +3 -0
- cryojax-0.2.2/docs/examples/data/ribosome_4ug0_particles.star +45 -0
- cryojax-0.2.2/docs/examples/data/ribosome_4ug0_scattering_potential_from_cistem.mrc +3 -0
- cryojax-0.2.2/docs/examples/read-dataset.ipynb +408 -0
- cryojax-0.2.2/docs/examples/simulate-helix.ipynb +261 -0
- cryojax-0.2.2/docs/examples/simulate-image.ipynb +353 -0
- cryojax-0.2.2/docs/examples/simulate-micrograph.ipynb +284 -0
- cryojax-0.2.2/docs/examples/test-multiatom.ipynb +434 -0
- cryojax-0.2.2/docs/index.md +114 -0
- cryojax-0.2.2/mkdocs.yml +68 -0
- cryojax-0.2.2/pyproject.toml +62 -0
- cryojax-0.2.2/src/cryojax/__init__.py +12 -0
- cryojax-0.2.2/src/cryojax/constants/__init__.py +4 -0
- cryojax-0.2.2/src/cryojax/constants/_load_atoms.py +57 -0
- cryojax-0.2.2/src/cryojax/constants/element_params.npy +0 -0
- cryojax-0.2.2/src/cryojax/coordinates/__init__.py +10 -0
- cryojax-0.2.2/src/cryojax/coordinates/_coordinates.py +287 -0
- cryojax-0.2.2/src/cryojax/core/__init__.py +12 -0
- cryojax-0.2.2/src/cryojax/core/_errors.py +35 -0
- cryojax-0.2.2/src/cryojax/core/_filter_specs.py +28 -0
- cryojax-0.2.2/src/cryojax/core/_filtered_transformations.py +105 -0
- cryojax-0.2.2/src/cryojax/core/_serialization.py +0 -0
- cryojax-0.2.2/src/cryojax/cryojax_version.py +16 -0
- cryojax-0.2.2/src/cryojax/data/__init__.py +11 -0
- cryojax-0.2.2/src/cryojax/data/_dataset.py +91 -0
- cryojax-0.2.2/src/cryojax/data/_particle_stack.py +36 -0
- cryojax-0.2.2/src/cryojax/data/_relion.py +424 -0
- cryojax-0.2.2/src/cryojax/image/__init__.py +26 -0
- cryojax-0.2.2/src/cryojax/image/_average.py +126 -0
- cryojax-0.2.2/src/cryojax/image/_edges.py +185 -0
- cryojax-0.2.2/src/cryojax/image/_fft.py +120 -0
- cryojax-0.2.2/src/cryojax/image/_map_coordinates.py +254 -0
- cryojax-0.2.2/src/cryojax/image/_normalize.py +120 -0
- cryojax-0.2.2/src/cryojax/image/_rescale_pixel_size.py +66 -0
- cryojax-0.2.2/src/cryojax/image/_spectrum.py +136 -0
- cryojax-0.2.2/src/cryojax/image/operators/__init__.py +36 -0
- cryojax-0.2.2/src/cryojax/image/operators/_filters.py +250 -0
- cryojax-0.2.2/src/cryojax/image/operators/_fourier_operator.py +203 -0
- cryojax-0.2.2/src/cryojax/image/operators/_masks.py +136 -0
- cryojax-0.2.2/src/cryojax/image/operators/_operator.py +194 -0
- cryojax-0.2.2/src/cryojax/image/operators/_real_operator.py +89 -0
- cryojax-0.2.2/src/cryojax/inference/__init__.py +1 -0
- cryojax-0.2.2/src/cryojax/inference/distributions/__init__.py +7 -0
- cryojax-0.2.2/src/cryojax/inference/distributions/_distribution.py +56 -0
- cryojax-0.2.2/src/cryojax/inference/distributions/_gaussian_distributions.py +104 -0
- cryojax-0.2.2/src/cryojax/inference/transforms/__init__.py +14 -0
- cryojax-0.2.2/src/cryojax/inference/transforms/_lie_group_transforms.py +131 -0
- cryojax-0.2.2/src/cryojax/inference/transforms/_transforms.py +236 -0
- cryojax-0.2.2/src/cryojax/io/__init__.py +20 -0
- cryojax-0.2.2/src/cryojax/io/_cif.py +50 -0
- cryojax-0.2.2/src/cryojax/io/_gemmi.py +122 -0
- cryojax-0.2.2/src/cryojax/io/_mdtraj.py +43 -0
- cryojax-0.2.2/src/cryojax/io/_mrc.py +238 -0
- cryojax-0.2.2/src/cryojax/io/_pdb.py +61 -0
- cryojax-0.2.2/src/cryojax/io/_starfile.py +28 -0
- cryojax-0.2.2/src/cryojax/rotations/__init__.py +6 -0
- cryojax-0.2.2/src/cryojax/rotations/_lie_group.py +527 -0
- cryojax-0.2.2/src/cryojax/rotations/_rotation.py +67 -0
- cryojax-0.2.2/src/cryojax/simulator/__init__.py +70 -0
- cryojax-0.2.2/src/cryojax/simulator/_assembly/__init__.py +6 -0
- cryojax-0.2.2/src/cryojax/simulator/_assembly/_assembly.py +107 -0
- cryojax-0.2.2/src/cryojax/simulator/_assembly/_helix.py +277 -0
- cryojax-0.2.2/src/cryojax/simulator/_config.py +167 -0
- cryojax-0.2.2/src/cryojax/simulator/_conformation.py +27 -0
- cryojax-0.2.2/src/cryojax/simulator/_detector.py +188 -0
- cryojax-0.2.2/src/cryojax/simulator/_dose.py +22 -0
- cryojax-0.2.2/src/cryojax/simulator/_ice.py +94 -0
- cryojax-0.2.2/src/cryojax/simulator/_instrument.py +138 -0
- cryojax-0.2.2/src/cryojax/simulator/_integrators/__init__.py +12 -0
- cryojax-0.2.2/src/cryojax/simulator/_integrators/_fourier_slice_extract.py +178 -0
- cryojax-0.2.2/src/cryojax/simulator/_integrators/_gaussian_mixture.py +120 -0
- cryojax-0.2.2/src/cryojax/simulator/_integrators/_nufft_project.py +113 -0
- cryojax-0.2.2/src/cryojax/simulator/_integrators/_potential_integrator.py +37 -0
- cryojax-0.2.2/src/cryojax/simulator/_optics.py +232 -0
- cryojax-0.2.2/src/cryojax/simulator/_pipeline.py +491 -0
- cryojax-0.2.2/src/cryojax/simulator/_pose.py +347 -0
- cryojax-0.2.2/src/cryojax/simulator/_potential/__init__.py +14 -0
- cryojax-0.2.2/src/cryojax/simulator/_potential/_atom_potential.py +48 -0
- cryojax-0.2.2/src/cryojax/simulator/_potential/_scattering_potential.py +24 -0
- cryojax-0.2.2/src/cryojax/simulator/_potential/_voxel_potential.py +623 -0
- cryojax-0.2.2/src/cryojax/simulator/_specimen.py +164 -0
- cryojax-0.2.2/src/cryojax/typing/__init__.py +70 -0
- cryojax-0.2.2/tests/__init__.py +0 -0
- cryojax-0.2.2/tests/conftest.py +172 -0
- cryojax-0.2.2/tests/data/.gitkeep +0 -0
- cryojax-0.2.2/tests/data/1uao.pdb +3 -0
- cryojax-0.2.2/tests/data/3j9g_potential_ps4_4.mrc +3 -0
- cryojax-0.2.2/tests/data/3j9g_subunit_potential_ps4_4.mrc +3 -0
- cryojax-0.2.2/tests/test_agree_with_cistem.py +167 -0
- cryojax-0.2.2/tests/test_atom_routines.py +111 -0
- cryojax-0.2.2/tests/test_detector.py +46 -0
- cryojax-0.2.2/tests/test_distribution.py +36 -0
- cryojax-0.2.2/tests/test_ensemble.py +40 -0
- cryojax-0.2.2/tests/test_fft.py +37 -0
- cryojax-0.2.2/tests/test_filters_and_masks.py +40 -0
- cryojax-0.2.2/tests/test_helix.py +165 -0
- cryojax-0.2.2/tests/test_jit.py +19 -0
- cryojax-0.2.2/tests/test_normalize.py +36 -0
- cryojax-0.2.2/tests/test_pose_agreement.py +78 -0
- cryojax-0.2.2/tests/test_potential.py +102 -0
- cryojax-0.2.2/tests/test_projection_agreement.py +32 -0
- cryojax-0.2.2/tests/test_shape.py +24 -0
- cryojax-0.2.2/tests/test_voxels_from_atoms.py +138 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Build docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
deploy:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout repository
|
|
13
|
+
uses: actions/checkout@v4
|
|
14
|
+
with:
|
|
15
|
+
fetch-depth: 0
|
|
16
|
+
|
|
17
|
+
- name: Set up Python
|
|
18
|
+
uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.10"
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: |
|
|
24
|
+
pip install --upgrade pip
|
|
25
|
+
pip install mkdocs
|
|
26
|
+
pip install mkdocs-gen-files
|
|
27
|
+
pip install mkdocs-same-dir
|
|
28
|
+
pip install pymdown-extensions
|
|
29
|
+
pip install mkdocs-pymdownx-material-extras
|
|
30
|
+
pip install mkdocs-autorefs
|
|
31
|
+
pip install mkdocs-simple-plugin
|
|
32
|
+
pip install mkdocstrings-python
|
|
33
|
+
pip install mknotebooks
|
|
34
|
+
pip install mkdocs-material
|
|
35
|
+
|
|
36
|
+
- name: Build
|
|
37
|
+
run: |
|
|
38
|
+
mkdocs build
|
|
39
|
+
|
|
40
|
+
# Push the site to github-pages
|
|
41
|
+
- name: GitHub Pages action
|
|
42
|
+
uses: peaceiris/actions-gh-pages@v3
|
|
43
|
+
with:
|
|
44
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
45
|
+
publish_dir: ./site
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
deploy:
|
|
10
|
+
name: Deploy
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
# IMPORTANT: this permission is mandatory for trusted publishing on PyPi
|
|
15
|
+
# see https://docs.pypi.org/trusted-publishers/
|
|
16
|
+
id-token: write
|
|
17
|
+
# This permission allows writing releases
|
|
18
|
+
contents: write
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
with:
|
|
23
|
+
fetch-depth: 0
|
|
24
|
+
|
|
25
|
+
- name: 🐍 Set up Python
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: "3.11"
|
|
29
|
+
|
|
30
|
+
- name: 👷 Build
|
|
31
|
+
run: |
|
|
32
|
+
python -m pip install build
|
|
33
|
+
python -m build
|
|
34
|
+
|
|
35
|
+
- name: 🚢 Publish to PyPI
|
|
36
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# GHA workflow for running tests.
|
|
2
|
+
#
|
|
3
|
+
# Largely taken from
|
|
4
|
+
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
|
5
|
+
# Please check the link for more detailed instructions
|
|
6
|
+
|
|
7
|
+
name: Tests
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
pull_request:
|
|
11
|
+
push:
|
|
12
|
+
branches:
|
|
13
|
+
- main
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
build:
|
|
17
|
+
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
strategy:
|
|
20
|
+
matrix:
|
|
21
|
+
python-version: ["3.11"]
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
26
|
+
uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
lfs: true
|
|
29
|
+
python-version: ${{ matrix.python-version }}
|
|
30
|
+
- name: Install Git LFS
|
|
31
|
+
run: |
|
|
32
|
+
sudo apt-get update
|
|
33
|
+
sudo apt-get install git-lfs
|
|
34
|
+
git lfs install
|
|
35
|
+
- name: Pull LFS Files
|
|
36
|
+
run: git lfs pull
|
|
37
|
+
- name: Install dependencies
|
|
38
|
+
run: |
|
|
39
|
+
python -m pip install --upgrade pip
|
|
40
|
+
pip install .[test]
|
|
41
|
+
- name: Test with pytest
|
|
42
|
+
run: |
|
|
43
|
+
pytest tests/
|
cryojax-0.2.2/.gitignore
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# See https://pre-commit.com for more information
|
|
2
|
+
# See https://pre-commit.com/hooks.html for more hooks
|
|
3
|
+
ci:
|
|
4
|
+
autoupdate_schedule: monthly
|
|
5
|
+
|
|
6
|
+
repos:
|
|
7
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
8
|
+
rev: v3.2.0
|
|
9
|
+
hooks:
|
|
10
|
+
- id: trailing-whitespace
|
|
11
|
+
- id: end-of-file-fixer
|
|
12
|
+
- id: check-yaml
|
|
13
|
+
- id: check-added-large-files
|
|
14
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
15
|
+
# Ruff version.
|
|
16
|
+
rev: v0.3.4
|
|
17
|
+
hooks:
|
|
18
|
+
# Run the linter.
|
|
19
|
+
- id: ruff
|
|
20
|
+
types_or: [ python, pyi, jupyter ]
|
|
21
|
+
args: [ --fix ]
|
|
22
|
+
# Run the formatter.
|
|
23
|
+
- id: ruff-format
|
|
24
|
+
types_or: [ python, pyi, jupyter ]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Contributor Guide
|
|
2
|
+
|
|
3
|
+
Contributions to this repository are welcome and greatly appreciated! I would love
|
|
4
|
+
for this package to grow and be supported by a larger community.
|
|
5
|
+
|
|
6
|
+
## Design principles
|
|
7
|
+
|
|
8
|
+
`cryojax` is built on [equinox](https://docs.kidger.site/equinox/). In short, `equinox` provides an object-oriented interface to writing parameterized functions in `jax`. The core object of these parameterized functions is called a [Module](https://docs.kidger.site/equinox/api/module/module/) (yes, this takes inspiration from pytorch). `equinox` ships with features to interact with these `Module`s, and more generally with [pytrees](https://jax.readthedocs.io/en/latest/pytrees.html) in `jax`. One of the most useful of these features, not found in `jax` itself, is a means of performing out-of-place updates on pytrees through `equinox.tree_at`.
|
|
9
|
+
|
|
10
|
+
Equinox also provides a recommended pattern for writing `Module`s: https://docs.kidger.site/equinox/pattern/. We think this is a good template for code readability, so `cryojax` tries to adhere to these principles as much as possible.
|
|
11
|
+
|
|
12
|
+
## Running tests and building the documentation
|
|
13
|
+
|
|
14
|
+
Both the tests and documentation use files stored remotely with git [LFS](https://git-lfs.com/). You will need to install `git lfs` locally in order to get these files.
|
|
15
|
+
|
|
16
|
+
## How to report a bug
|
|
17
|
+
|
|
18
|
+
Report bugs on the [Issue Tracker](https://github.com/mjo22/cryojax/issues).
|
|
19
|
+
|
|
20
|
+
When filing an issue, make sure to answer these questions:
|
|
21
|
+
|
|
22
|
+
- Which operating system and Python version are you using?
|
|
23
|
+
- Which version of this project are you using?
|
|
24
|
+
- What did you do?
|
|
25
|
+
- What did you expect to see?
|
|
26
|
+
- What did you see instead?
|
|
27
|
+
|
|
28
|
+
The best way to get your bug fixed is to provide a test case, and/or steps to
|
|
29
|
+
reproduce the issue. In particular, please include a [Minimal, Reproducible
|
|
30
|
+
Example](https://stackoverflow.com/help/minimal-reproducible-example).
|
|
31
|
+
|
|
32
|
+
## How to request a feature
|
|
33
|
+
|
|
34
|
+
Feel free to request features on the [Issue
|
|
35
|
+
Tracker](https://github.com/mjo22/cryojax/issues).
|
|
36
|
+
|
|
37
|
+
## How to submit changes
|
|
38
|
+
|
|
39
|
+
Open a [Pull Request](https://github.com/mjo22/cryojax/pulls).
|