"Modernise GrainSizeTools: uv, importable package, and PyPI release"#20
Open
jwestraadt wants to merge 7 commits intomarcoalopez:masterfrom
Open
"Modernise GrainSizeTools: uv, importable package, and PyPI release"#20jwestraadt wants to merge 7 commits intomarcoalopez:masterfrom
jwestraadt wants to merge 7 commits intomarcoalopez:masterfrom
Conversation
- Add pyproject.toml with project metadata and dependencies (including pyyaml which was missing from requirements.txt) - Add uv.lock for reproducible installs - Pin Python 3.11 via .python-version - Update README.md with uv installation instructions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add grain_size_tools/__init__.py exposing summarize, get_filepath, function_list and all submodules (averages, plot, stereology, piezometers, template) - Fix GrainSizeTools_script.py: move averages import to module level so summarize() works when imported (not just when %run) - Fix piezometers.py: resolve piezometric_database.yaml via Path(__file__).parent so it loads correctly from any working directory - Fix plot.py: remove emoji characters causing UnicodeEncodeError on Windows - Update DOCS notebooks to use new import style (import grain_size_tools as gst) replacing all %run usage and hardcoded local paths - Update README.md with Usage section and import examples Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace Anaconda/pip install instructions with uv workflow in _first_steps.md and getting started_src.md - Replace '%run GrainSizeTools_script.py' with 'import grain_size_tools as gst' throughout all docs - Update all module calls: plot.* -> gst.plot.*, stereology.* -> gst.stereology.*, averages.* -> gst.averages.*, summarize() -> gst.summarize() - Update piezometers API: old piezometers.quartz() -> load_piezometers_from_yaml() + list_piezometers(db) + calc_diffstress(db.phase.__dict__['name'], grain_size=x) - Replace hardcoded local filepaths with URL in stereology_module.md, _describe.md, _Paleopizometry.md - Replace calc_shape() with two_step() in stereology_module.md - Remove emoji from _Plot_module.md console output - Update Step 4 package structure description in getting started_src.md - Add deprecation notice to brief_tutorial.md (legacy v2.0 docs) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename package to grainsizetools-jwestraadt - Update author/maintainer to Johan Westraadt - Update repository URL to jwestraadt fork, keep original project link - Add optional jupyter extra for jupyterlab - Bump version to 3.2.1 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add Option A: pip install from PyPI (with jupyter extra) - Rename Option B: install from source using uv - Update clone URL to jwestraadt fork Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR modernises the GrainSizeTools project with the following changes:
Package management
pyproject.tomlwith all dependencies (includingpyyamlwhich was previously missing).python-versiongrainsizetools-jwestraadtwith an optional[jupyter]extraImportable package
grain_size_tools/into a proper Python package with__init__.pyimport grain_size_tools as gstpiezometers.py(Path(__file__).parent)averagesmodule-level import inGrainSizeTools_script.pyplot.pycausingUnicodeEncodeErroron WindowsDocumentation
quatifying_grain_size_pops.ipynb,paleopiezometry_module.ipynb,stereology_module.ipynb) to use newgst.*import styleplot.*→gst.plot.*,stereology.*→gst.stereology.*, etc.calc_shape()withtwo_step()in stereology docsbrief_tutorial.md)README.mdwith PyPI and uv install instructionsTest plan
pip install "grainsizetools-jwestraadt[jupyter]"installs correctlyimport grain_size_tools as gstworks after installgst.summarize(),gst.plot.distribution(),gst.stereology.Saltykov(),gst.piezometers.calc_diffstress()all function correctly🤖 Generated with Claude Code"