This document covers environment setup for both users (who just want to run pydsm) and developers (who want to run tests, modify the code, or build the docs).
If you just want to use pydsm in your own project:
conda env create -f environment.yml
conda activate pydsmThis installs the core runtime plus visualization extras (geopandas, shapely)
as defined in environment.yml, which mirrors
[project.dependencies] + [project.optional-dependencies.viz] from pyproject.toml.
The developer environment adds testing tools (pytest, pyarrow, black, flake8)
on top of the core runtime and viz extras. It does not include documentation tools.
conda env create -f environment_dev.yml
conda activate pydsm-devenvironment_dev.yml runs pip install -e . automatically, so the package is
immediately importable in editable mode — no separate install step needed.
If you prefer to manage the environment yourself you can also do:
pip install -e ".[dev]" # installs test + docs extras declared in pyproject.tomlpytest tests/Several tests compare DataFrame output against stored Parquet snapshots in
tests/data/. These are checked into the repository and should be stable
across library upgrades because Parquet is a format-stable columnar format
(unlike pickle, which encodes Python/numpy internals).
The fixture logic lives in tests/conftest.py. Tests
accept the assert_frame_fixture fixture as a parameter; it loads the
corresponding .parquet file and compares with pd.testing.assert_frame_equal.
Regenerate fixtures when:
- A deliberate change to a reader method changes the expected output, or
- A major library upgrade (pandas, numpy) changes dtype or value representation
pytest --regen-fixtures tests/This overwrites every .parquet file in tests/data/ with the current output.
After regenerating, review the diff carefully (git diff tests/data/) and commit
the updated fixtures alongside the code change that caused them.
- Add the
assert_frame_fixtureparameter to your test method. - Call
assert_frame_fixture(df, "my_fixture_name"). - Run
pytest --regen-fixtures tests/test_yourfile.py::your_testonce to createtests/data/my_fixture_name.parquet. - Commit
tests/data/my_fixture_name.parquettogether with the test.
A separate minimal environment is provided for documentation builds:
conda env create -f environment-docs.yml
conda activate pydsm-docsBuild the HTML docs:
cd docsrc
make html # output goes to docsrc/_build/html/Live-reload during writing:
sphinx-autobuild docsrc docsrc/_build/html| Extra | Install | What it adds |
|---|---|---|
viz |
pip install "pydsm[viz]" |
geopandas, shapely (for pydsm.viz) |
test |
pip install "pydsm[test]" |
pytest, pytest-cov, pyarrow |
docs |
pip install "pydsm[docs]" |
Sphinx and related tools |
dev |
pip install "pydsm[dev]" |
All of test + docs + black, flake8, twine |
| File | Purpose |
|---|---|
environment.yml |
User runtime — core + viz |
environment_dev.yml |
Developer — core + viz + test tools |
environment-docs.yml |
Full — core + viz + test + docs (Python 3.11 pinned) |