Skip to content

refactor(NESP): reorganise into per-dataset folders and installable package#50

Open
diodon wants to merge 2 commits intomasterfrom
feature/nesp-refactor
Open

refactor(NESP): reorganise into per-dataset folders and installable package#50
diodon wants to merge 2 commits intomasterfrom
feature/nesp-refactor

Conversation

@diodon
Copy link
Copy Markdown
Contributor

@diodon diodon commented Mar 27, 2026

Summary

  • Per-dataset foldersamsa/, seabird/, seagrass/, dugongs/, kelp/, nrmn/: each contains its notebooks (.ipynb + .Rmd) and a dedicated README.md with dataset description, S3 path, and notebook index. Folders for dugongs, kelp, and nrmn include placeholder READMEs ready for future notebooks.
  • nesp installable packageutil.py converted into a proper Python package (nesp/util.py + nesp/__init__.py) with hatchling declared as the build backend in pyproject.toml. Notebooks now import via from nesp import util and work from any directory after uv pip install ..
  • Root README.md rewritten — covers folder structure, full dataset table with S3 paths, Python (uv/pip) setup, R package setup, and a link to the H3 reference doc.

Test plan

  • Run uv pip install . from NESP/ and verify no errors
  • Open each notebook (amsa, seabird, seagrass) and confirm from nesp import util resolves correctly
  • Check that util.generate_pydeck_hexagon_layers, util.print_schema_rich_table, and util.TOOLTIP are accessible via the installed package

🤖 Generated with Claude Code

…ackage

- Create subdirectories for each dataset: amsa/, seabird/, seagrass/,
  dugongs/, kelp/, nrmn/ — notebooks and R markdown files moved into
  their respective folders
- Convert util.py into an installable `nesp` package (nesp/__init__.py +
  nesp/util.py) so notebooks can use `from nesp import util` without
  path manipulation
- Add hatchling build-system to pyproject.toml with explicit package
  declaration for the nesp wheel
- Update all three Python notebooks to replace `import util` with
  `from nesp import util`
- Add a concise README.md to each dataset folder (description, S3 path,
  notebook table, dataset-specific notes); dugongs/, kelp/, nrmn/ include
  placeholder stubs for notebooks yet to be written
- Rewrite root NESP/README.md to document the full folder structure,
  Python (uv/pip) and R environment setup, and link to h3.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@diodon diodon requested a review from thommodin March 27, 2026 20:03
@thommodin
Copy link
Copy Markdown
Contributor

Thanks @diodon, I ran the tests and had to update the package __init__.py to fix this...

Did you run the tests locally as well? I'm wondering if this is just my system working strangely...

Copy link
Copy Markdown
Contributor

@thommodin thommodin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to update the __init__.py but otherwise fine... Was there a particular reason to run this as a package instead of a file import?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants