Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
24f9964
Implement some index operations
AstroPatty Apr 6, 2026
42ff07a
Some take operations
AstroPatty Apr 6, 2026
599bdf5
some more implementation
AstroPatty Apr 6, 2026
dd2a016
Implement chunked_from_chunked
AstroPatty Apr 6, 2026
7bf2205
Fixes for unsorted chunks
AstroPatty Apr 6, 2026
a5940ba
Add changelog, fix type-check
AstroPatty Apr 6, 2026
c673ec5
Make index typing more consistent
AstroPatty Apr 7, 2026
0caad1d
Add index stubs
AstroPatty Apr 7, 2026
39947a3
Update tree handling
AstroPatty Apr 7, 2026
a0c572f
Fix index exclusion
AstroPatty Apr 7, 2026
b263eaf
Merge pull request #225 from ArgonneCPAC/release
AstroPatty Apr 7, 2026
8b9a714
Merge main into index branch
AstroPatty Apr 7, 2026
7ae1431
Updates to contributing documentation
AstroPatty Apr 7, 2026
c6a6922
Update building CI pipeline
AstroPatty Apr 7, 2026
372ae91
Merge pull request #224 from ArgonneCPAC/indexing-ops-rs
AstroPatty Apr 7, 2026
a357de6
Update healsparse map logic to build from scratch
AstroPatty Apr 8, 2026
ea0d7ad
Move healsparse map creation logic out of get_data
AstroPatty Apr 8, 2026
071f4cd
Process all columns in healpixmap at once when making healsparse map.
AstroPatty Apr 8, 2026
37f253c
Add changelog
AstroPatty Apr 8, 2026
f20cfd4
Small test fix
AstroPatty Apr 8, 2026
bdbc91b
Implement masked numpy arrays for healpix output
AstroPatty Apr 8, 2026
b96a802
Update documentation
AstroPatty Apr 8, 2026
363fef7
Update changelog
AstroPatty Apr 8, 2026
2e0ff57
Merge pull request #226 from ArgonneCPAC/healpix-map-speed
AstroPatty Apr 8, 2026
13f479c
added animate_halo function
Mar 9, 2026
f216338
debugging animate_halo function + other things
Apr 2, 2026
7e001e0
can call either visualize_halo or alo
Apr 2, 2026
b3f817d
documenting animate_halos
Apr 9, 2026
5b94bd0
changelog
Apr 9, 2026
d8361fe
rendering animate_halo docs
Apr 9, 2026
9abe953
type checker
Apr 9, 2026
5fce7fd
type check
Apr 9, 2026
d4cbc75
type check
Apr 9, 2026
c1eec63
type check
Apr 9, 2026
671afca
type check
Apr 9, 2026
f5f3a48
Move everything to column producers
AstroPatty Apr 10, 2026
4a52ed2
Basic writes working with producers
AstroPatty Apr 10, 2026
c3acea7
Correct raw data caching behavior with column conversions
AstroPatty Apr 10, 2026
1449a20
Add new instantiate file, remove derived file
AstroPatty Apr 10, 2026
6371e7a
All serial tests working
AstroPatty Apr 10, 2026
b03aa2a
Move rest of dataset instantiation logic to new file
AstroPatty Apr 10, 2026
b1091f3
Move make_schema to its own file
AstroPatty Apr 10, 2026
1f3f4f2
Changelog
AstroPatty Apr 10, 2026
a2ff640
Merge pull request #228 from ArgonneCPAC/column-producers
AstroPatty Apr 10, 2026
e03f1d8
type check
Apr 13, 2026
dbaae37
addressing failing tests
Apr 13, 2026
bba7d98
Move with_new_columns out of state
AstroPatty Apr 14, 2026
d6aac0a
Add correct file
AstroPatty Apr 14, 2026
99953b8
Significant rewrite to ensure column producer uniqueness with UUIDs
AstroPatty Apr 14, 2026
a0ba14b
bugfix + updated docs
Apr 15, 2026
7e6a447
type check again...
Apr 15, 2026
d85944e
docs
Apr 15, 2026
1912159
docs
Apr 15, 2026
ad04c38
Merge pull request #227 from ArgonneCPAC/animations
AstroPatty Apr 15, 2026
b7dd0a4
Add no_cache option to derived columns
AstroPatty Apr 17, 2026
6022621
Add reindexing logic for diffsky
AstroPatty Apr 17, 2026
8c9d3c7
Add allow_overwrite to with_new_columns and evalute apis
AstroPatty Apr 21, 2026
f6079c4
Offset plugin for diffsky lightcones
AstroPatty Apr 23, 2026
2c090f1
Add basic plugin specification
AstroPatty Apr 23, 2026
b083c4d
Move top_host_idx reindexing into plugin system
AstroPatty Apr 23, 2026
8f1511a
Add new test and changelog
AstroPatty Apr 23, 2026
c4e3de4
Add fixes for writing with stacking
AstroPatty Apr 24, 2026
7d22512
Fix docs for renaming
AstroPatty Apr 24, 2026
896aa3e
Skip setting up AWS cli if cache already exists
AstroPatty Apr 24, 2026
22abc15
Add some MPI logic, which will be wired up in a later PR
AstroPatty Apr 27, 2026
78979c4
Merge pull request #232 from ArgonneCPAC/plugins
AstroPatty Apr 27, 2026
2dfa8cc
Add support for index plugins
AstroPatty Apr 27, 2026
333250e
Reorganization for lightcone
AstroPatty Apr 28, 2026
5aa07e2
More plugin work
AstroPatty Apr 28, 2026
f14fd06
Small reworks to guarantee plugin consistency
AstroPatty Apr 28, 2026
e6eb426
Unify 'take' operations on DatasetState to ensure consistent plugin a…
AstroPatty Apr 28, 2026
74744b4
Diffsky plugins now work with sorting
AstroPatty Apr 28, 2026
550f303
Changelog
AstroPatty Apr 28, 2026
715763f
Small bugfixes
AstroPatty Apr 28, 2026
42a8d25
Small bugfixes
AstroPatty Apr 28, 2026
a9762a3
Fixes for healpixmap tests
AstroPatty Apr 28, 2026
b829eb1
Whatever you do, do not look at this commit
AstroPatty Apr 29, 2026
a58c305
Merge pull request #233 from ArgonneCPAC/index-plugins
AstroPatty Apr 29, 2026
157631b
Add diffsky partition plugin
AstroPatty Apr 29, 2026
9d6393f
Add tests for diffsky partition plugin
AstroPatty Apr 29, 2026
cceaa1b
Update diffsky partitioning algorithm.
AstroPatty Apr 29, 2026
a00a889
Write tests for mpi write partitioning
AstroPatty Apr 29, 2026
c1d1885
Add changelog, fix tests
AstroPatty Apr 29, 2026
6d5c596
Merge pull request #234 from ArgonneCPAC/partition-plugins
AstroPatty Apr 29, 2026
759700b
Add context and hook implementation
AstroPatty Apr 29, 2026
e9994f6
Move plugin registration and calls to new system
AstroPatty Apr 29, 2026
6bfc9e5
Move lightcone radec generation into plugin
AstroPatty Apr 29, 2026
2827696
Fix keep_top_host logic to only fire on single datasets
AstroPatty Apr 30, 2026
0e22808
Merge pull request #235 from ArgonneCPAC/plugin-cleanup
AstroPatty Apr 30, 2026
211c5de
Fix merge conflict
AstroPatty Apr 30, 2026
36dbb1d
Merge pull request #238 from ArgonneCPAC/release-merge-fix
AstroPatty Apr 30, 2026
ae6eed4
Move verification code out of the dataset
AstroPatty Apr 30, 2026
0c88fb5
Break DatasetState apart for future changes
AstroPatty May 1, 2026
11662c7
Update tests and fix changelog
AstroPatty May 1, 2026
2fa491a
One more test fix
AstroPatty May 1, 2026
b885c9e
Merge pull request #239 from ArgonneCPAC/state-cleanup
AstroPatty May 1, 2026
459cf18
Global random take implementation
AstroPatty May 12, 2026
6a9b8c9
Global take_range implementation
AstroPatty May 12, 2026
1fdb721
no longer throw, fix take with
AstroPatty May 12, 2026
9b089e0
Fix unbound local error, fix test for new behavior
AstroPatty May 12, 2026
aaef87f
Implement in structurecollection, implement helper index routine for …
AstroPatty May 13, 2026
4a7f1a8
Takes working for chunked index as well
AstroPatty May 14, 2026
b77d875
Updates for lightcone, significant testing
AstroPatty May 14, 2026
c1cd8e3
Fixes for a few tests
AstroPatty May 14, 2026
37905e8
Small updates, add changelog
AstroPatty May 14, 2026
aebf117
Fix for zero-length lightcones
AstroPatty May 14, 2026
8b53edd
Fix sorted lightcones, disable tests that will be updated in differen…
AstroPatty May 14, 2026
6ca6230
Merge pull request #240 from ArgonneCPAC/global-take
AstroPatty May 14, 2026
c57e81e
Unify column and metadata column handling in hdf5 handler
AstroPatty May 15, 2026
372e86d
Unify column and metadata column in state and instantiation
AstroPatty May 15, 2026
084b7fc
Add test for metadata column arithmetic
AstroPatty May 15, 2026
c421be5
Revert accidental changelog overwrite
AstroPatty May 15, 2026
56f57dd
Merge pull request #241 from ArgonneCPAC/unify-metadata
AstroPatty May 15, 2026
5712e15
Initial working implementation of the lightcone structure collection
AstroPatty May 1, 2026
580c89a
Generate ra, theta, chi, redshift, from raw coordinates
AstroPatty May 7, 2026
7d9d7dd
Linking to galaxies in a lightcone structure collection is working
AstroPatty May 7, 2026
4df804d
Add rebuilding for nested galaxy structure collections
AstroPatty May 15, 2026
e3b7ff1
Updates to fix galaxy linking
AstroPatty May 15, 2026
f3ab876
Implement filtering with derived columns
AstroPatty May 18, 2026
cbf5ea1
Implement additional testing
AstroPatty May 18, 2026
5169c61
Changelog, additional test
AstroPatty May 18, 2026
268f299
Remove unneeded force_binary flag
AstroPatty May 18, 2026
abb7663
Merge pull request #242 from ArgonneCPAC/beter-filtering
AstroPatty May 19, 2026
4a860ba
Implement writing and re-reading for lightcone structure collections
AstroPatty May 19, 2026
54fe1c9
Make updates for sorted lightcone structure collection
AstroPatty May 19, 2026
3036755
Writes with galaxy linking
AstroPatty May 19, 2026
c4f1e4a
Implement fixes for parallel output
AstroPatty May 20, 2026
f00531c
Implement lightcone convinience methods on structure collection
AstroPatty May 20, 2026
8c0fa8c
Merge branch 'main' into lightcone-structure-collection
AstroPatty May 20, 2026
f579245
Add changelog
AstroPatty May 20, 2026
15f90f2
Fixed a bug that could cause failures when one rank had no data to wr…
AstroPatty May 20, 2026
48682fc
Fix a bug that may be causing some MPI tests to fail periodically
AstroPatty May 20, 2026
c40b364
Remove debugginc code
AstroPatty May 20, 2026
c1ad6ff
Fix a test that was incorrectly failing
AstroPatty May 20, 2026
310de71
One more test fix
AstroPatty May 20, 2026
05d3121
More robust setup for lightcone test
AstroPatty May 20, 2026
6ef3272
Merge pull request #243 from ArgonneCPAC/lightcone-structure-collection
AstroPatty May 20, 2026
af8bf6e
Implement get_pixels and pixel_search on lightcone
AstroPatty May 21, 2026
7ed44ea
Add docstrings and implement on structure collection
AstroPatty May 21, 2026
b30d357
Add changelog
AstroPatty May 21, 2026
dac42c0
Fix type errors
AstroPatty May 21, 2026
667cb53
Some fixes and new tests
AstroPatty May 21, 2026
3eb8ab6
Implement projection in rust
AstroPatty May 21, 2026
3c8fad6
Merge pull request #244 from ArgonneCPAC/pixel-query
AstroPatty May 21, 2026
4c511ff
Updated healpix containment algorithm to improve spatial query speed
AstroPatty May 22, 2026
334652d
Remove debugging code
AstroPatty May 22, 2026
6e0b6ce
Merge pull request #245 from ArgonneCPAC/healpix-bound-checking
AstroPatty May 22, 2026
fff56d8
Update release pipeline for pre-releases
AstroPatty May 22, 2026
2721fc3
Merge pull request #246 from ArgonneCPAC/ci-update
AstroPatty May 22, 2026
09141d2
Update bumpmyversion
AstroPatty May 22, 2026
b9b5f9b
Update version locations
AstroPatty May 22, 2026
eee2b72
Update bumpversion config
AstroPatty May 22, 2026
baa75ae
Allow release to run on main for pre-release versions
AstroPatty May 22, 2026
452a979
Correctly serialize hyphenated pre-release
AstroPatty May 22, 2026
6eeb910
Add jax output, allow evaluate to use other formats
AstroPatty May 24, 2026
5fceb99
Add updated evaluate formats tests
AstroPatty May 24, 2026
91d1a78
Add support for other formats to StructureCollection.evaluate
AstroPatty May 27, 2026
df709ec
Update docstrings to better reflect behavior
AstroPatty May 27, 2026
a8edab8
Add changelog
AstroPatty May 27, 2026
7697925
Delete a bunch of dead code
AstroPatty May 27, 2026
4b2a88a
Merge pull request #247 from ArgonneCPAC/jax-output
AstroPatty May 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[tool.bumpversion]
current_version = "1.2.5"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
current_version = "1.2.6"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)[-.]?(?P<pre_l>a|b|rc)?(?P<pre_n>\\d+)?"
serialize = [
"{major}.{minor}.{patch}-{pre_l}{pre_n}",
"{major}.{minor}.{patch}",
]
search = "{current_version}"
replace = "{new_version}"
regex = false
Expand All @@ -21,11 +24,21 @@ pre_commit_hooks = []
post_commit_hooks = []
allow_shell_hooks = true

[tool.bumpversion.parts.pre_l]
optional_value = "final"
values = ["a", "b", "rc", "final"]

[tool.bumpversion.parts.pre_n]
first_value = "1"

[[tool.bumpversion.files]]
filename = "src/opencosmo/__init__.py"
filename = "python/opencosmo/__init__.py"

[[tool.bumpversion.files]]
filename = "pyproject.toml"

[[tool.bumpversion.files]]
filename = "docs/source/conf.py"

[[tool.bumpversion.files]]
filename = "Cargo.toml"
51 changes: 27 additions & 24 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build dev
on:
on:
workflow_call:
inputs:
push-docker:
Expand All @@ -14,34 +14,37 @@ on:
required: false

jobs:
build-wheel:
runs-on: ubuntu-latest
build-wheels:
name: Build wheels (${{ matrix.target }})
strategy:
matrix:
include:
- { os: ubuntu-latest, target: x86_64 }
- { os: ubuntu-latest, target: aarch64 }
- { os: macos-latest, target: x86_64-apple-darwin }
- { os: macos-latest, target: aarch64-apple-darwin }
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
if: matrix.os != 'ubuntu-latest'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
uses: astral-sh/setup-uv@v6
python-version: |
3.12
3.13
3.14
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
version: "0.8.2"
- name: Build package
run: uv build

build-container:
runs-on: ubuntu-latest
steps:
- id: login
if: ${{ inputs.push-docker }}
uses: docker/login-action@v3
target: ${{ matrix.target }}
manylinux: auto
args: --release --out dist --interpreter 3.12 3.13 3.14
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
username: ${{ secrets.docker-username }}
password: ${{ secrets.docker-access-key }}
- uses: docker/setup-buildx-action@v3
- uses: docker/bake-action@v6
with:
push: ${{ inputs.push-docker }}
targets: dev
name: wheels-${{ matrix.target }}
path: dist/


2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ jobs:
run: uv run ruff check .

- name: Run mypy type checker
run: uv run mypy src/opencosmo
run: uv run mypy python/opencosmo


129 changes: 110 additions & 19 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,150 @@ on:
type: string

jobs:
release:
prepare:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
prerelease: ${{ steps.check-version.outputs.prerelease }}
steps:
- name: Check if pre-release
id: check-version
run: |
if echo "${{ inputs.version }}" | grep -qE '(a|b|rc|alpha|beta|dev)[0-9]*$'; then
echo "prerelease=true" >> "$GITHUB_OUTPUT"
echo "ref=main" >> "$GITHUB_OUTPUT"
else
echo "prerelease=false" >> "$GITHUB_OUTPUT"
echo "ref=release" >> "$GITHUB_OUTPUT"
fi

- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_PAT }}
ref: 'release'
ref: ${{ steps.check-version.outputs.ref }}

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.8.2"

- name: Set version
run: echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV

- name: Bump version files
# Uses --new-version so you don't need to specify major/minor/patch.
# commit=false and tag=false are already set in .bumpversion.toml so
# bump-my-version only updates the files.
run: uvx bump-my-version bump --new-version ${{ env.VERSION }}
run: uvx bump-my-version bump --new-version ${{ inputs.version }}

- name: Draft changelog (captured for GitHub release body)
run: uv run towncrier build --draft --version ${{ env.VERSION }} > release_notes.rst
run: uv run towncrier build --draft --version ${{ inputs.version }} > release_notes.rst

- name: Build changelog
# Writes to docs/source/changelog.rst and removes news fragments in changes/
run: uv run towncrier build --yes --version ${{ env.VERSION }}
if: steps.check-version.outputs.prerelease == 'false'
run: uv run towncrier build --yes --version ${{ inputs.version }}

- name: Commit, tag, and push release branch
if: steps.check-version.outputs.prerelease == 'false'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -B release
git add --all
git commit -m "Release ${{ env.VERSION }}"
git tag ${{ env.VERSION }}
git commit -m "Release ${{ inputs.version }}"
git tag ${{ inputs.version }}
git push origin release --force
git push origin ${{ env.VERSION }}
git push origin ${{ inputs.version }}

- name: Build package
run: uv build
- name: Tag pre-release
if: steps.check-version.outputs.prerelease == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add --all
git commit -m "Release ${{ inputs.version }}"
git tag ${{ inputs.version }}
git push origin ${{ inputs.version }}

- name: Upload release notes
uses: actions/upload-artifact@v4
with:
name: release-notes
path: release_notes.rst

build-wheels:
needs: prepare
name: Build wheels (${{ matrix.target }})
strategy:
matrix:
include:
- { os: ubuntu-latest, target: x86_64 }
- { os: ubuntu-latest, target: aarch64 }
- { os: macos-latest, target: x86_64-apple-darwin }
- { os: macos-latest, target: aarch64-apple-darwin }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.version }}
- name: Set up Python
if: matrix.os != 'ubuntu-latest'
uses: actions/setup-python@v5
with:
python-version: |
3.12
3.13
3.14
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
args: --release --out dist --interpreter 3.12 3.13 3.14
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.target }}
path: dist/

publish:
needs: build-wheels
runs-on: ubuntu-latest
steps:
- name: Download wheels
uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist/
merge-multiple: true

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.8.2"

- name: Publish to PyPI
run: uv publish --token ${{ secrets.PYPI_TOKEN }}

github-release:
needs: [publish, prepare]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download wheels
uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist/
merge-multiple: true

- name: Download release notes
uses: actions/download-artifact@v4
with:
name: release-notes

- name: Create GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VERSION }}
tag: ${{ inputs.version }}
bodyFile: release_notes.rst
artifacts: dist/*
makeLatest: true
prerelease: ${{ needs.prepare.outputs.prerelease == 'true' }}
makeLatest: ${{ needs.prepare.outputs.prerelease == 'false' }}
13 changes: 7 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ jobs:
get-test-data:
runs-on: ubuntu-latest
steps:
- name: Setup AWS CLI
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TEST_DATA_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.TEST_DATA_SECRET_KEY }}
aws-region: us-west-2
- name: check if cache exists
id: check-cache
uses: actions/cache@v4
Expand All @@ -19,6 +13,13 @@ jobs:
lookup-only: true
restore-keys: |
test-data
- name: Setup AWS CLI
if: steps.check-cache.outputs.cache-hit != 'true'
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TEST_DATA_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.TEST_DATA_SECRET_KEY }}
aws-region: us-west-2
- name: Download test data
if: steps.check-cache.outputs.cache-hit != 'true'
run: aws s3 cp s3://${{ secrets.TEST_DATA_BUCKET }}/test_data.tar.gz test_data.tar.gz
Expand Down
19 changes: 15 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,20 @@ If you find that the documentation is not quite up to par, feel free to create a

In addition to raising issues on the repository or adding documentation, we welcome PRs that fix bugs, improve performance, or add new features. The remainder of this document describes how to go about setting up a development environment and prepping your PR for merging.

### Step 0: Install UV
### Step 0: Install UV and Build Dependencies

We use [uv](https://docs.astral.sh/uv/) to manage dependencies and provide a consistent execution environment for packaging and testing. If you do not already have uv installed on your machine, [follow the documentation](https://docs.astral.sh/uv/getting-started/installation/) for your system.

Becuase `opencosmo` includes some Rust extension modules, it uses [maturin](https://github.com/pyo3/maturin) as its build system and requires a Rust compiler. `uv` should install `maturin`, which is capable of bootstrapping itself. This should all happen automatically in step 2 below, but if for some reason this does not work you may need [install a rust compiler manually](https://rust-lang.org/tools/install/)


### Step 1: Create a Fork of the OpenCosmo Repo and Clone

You should preform your development in your own personal fork of the repository. You can create one [at this link](https://github.com/ArgonneCPAC/OpenCosmo/fork). Once you have a fork, you can clone it to the machine you will be doing your development on.

### Step 2: Create a Virtual Environment with UV
If you're only planning to make a single contribution, it's fine to commit to the main branch of your fork. If you intend to make many contributions, we recommend creating a branch for each feature.

### Step 2: Create a Virtual Environment with UV and Install Dependencies

In addition to managing dependencies, uv manages a virtual environment with the appropriate versions of all packages. From the root of the repository, run the command:

Expand All @@ -32,6 +37,8 @@ uv sync

This will create a virtual environment in the repository and install all necessary dependencies, as well as extra dependencies required for development work.

As part of the initial `uv sync`, `maturin` will build the rust extension modules and install them in the correct place. This may take some time, but unless you are modifying the rust code it will only have to happen once.

### Step 2.1: Install Parallel HDF5 (Optional)

If you plan to work on features that involve parallel I/O, you will need to install parallel HDF5 to run parallel tests. To start, install the additional packages necessary for developing and testing parallel features
Expand All @@ -49,7 +56,9 @@ Note that running with uv is required to ensure that the parallel version of HDF

### Step 3: Add a Commit & Create a PR

I know what you're thinking: I haven't actually implemented my changes yet. Why am I already submitting a PR? Two reasons. First, so we know what people are working on so we're not doing duplicate work. Second, so that your PR starts running through the CI pipeline.
I know what you're thinking: I haven't actually implemented my changes yet. Why am I already submitting a PR? Two reasons. First, so we know what people are working on so we're not doing duplicate work. Second, so that your PR starts running through the CI pipeline. This will make it easier down the line!

For more details of how to do all this, see the [GitHub documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)

### Step 4: Implement Your Changes

Expand All @@ -59,6 +68,8 @@ This is where the magic happens. Implement your features! If you have questions,

Our CI pipeline performs linting with [ruff](https://astral.sh/ruff) and static type checking with [mypy](https://www.mypy-lang.org/). Both should have been installed automatically when you ran `uv sync`. Your PR must pass both to be merged. If you prefer, you can use [pre-commit](https://pre-commit.com/) to automatically run linting and type checking before you commit. Altenatively, you can call them manually on your last commit.

If you're unfamiliar with type hints, go ahead and implement your features without them and we can worry about the details later.

Many libraries do not have full typing support. If this is the case, you can add a `# type: ignore` directive when you import them. If the type stubs exist as a seperate library, you should instead add them as a development dependency in the pyprojet.toml with

```bash
Expand All @@ -79,7 +90,7 @@ uv run pytest --ignore=test/parallel
If you are working on features designed to be used in an MPI context, you can run the parallel tests with:

```bash
uv run mpiexec -n 4 pytest -m parallel test/parallel -x
uv run mpiexec -n 4 pytest -m parallel test/parallel
```

All tests must pass for your PR to be merged.
Expand Down
Loading
Loading