Refactor to standard Python package structure#19
Merged
Conversation
Co-authored-by: SBFRF <8375832+SBFRF@users.noreply.github.com>
Co-authored-by: SBFRF <8375832+SBFRF@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor repository organization for better deployability
Refactor to standard Python package structure
Feb 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the repo into an installable Python package (pydiwasp) with updated imports, packaging metadata, and documentation/examples so users can pip install and import via pydiwasp.
Changes:
- Introduces
pydiwasp/package +pydiwasp.private/subpackage and updates internal imports to be package-relative. - Updates tests/examples/docs to import via
pydiwaspinstead of root-level modules. - Adds/updates packaging files (
pyproject.toml,MANIFEST.in,setup.py) to support building/installing the package.
Reviewed changes
Copilot reviewed 15 out of 35 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_integration.py | Updates integration test imports to use pydiwasp. |
| tests/test_core.py | Updates core test imports to use pydiwasp.private paths. |
| tests/test_api.py | Updates API tests to import public functions from pydiwasp. |
| setup.py | Restricts package discovery to pydiwasp packages. |
| pyproject.toml | Adds PEP 518/621 project/build metadata for packaging. |
| MANIFEST.in | Adds sdist include/exclude rules for key repo files. |
| README.md | Updates installation and import examples for installed package usage. |
| examples/pyDIWASP_example.ipynb | Removes sys.path manipulation; imports from pydiwasp. |
| pydiwasp/init.py | Defines package public API re-exports. |
| pydiwasp/dirspec.py | Switches to relative imports for package modules. |
| pydiwasp/infospec.py | Updates internal import to use package-relative private. |
| pydiwasp/interpspec.py | Updates internal imports to use package-relative private. |
| pydiwasp/plotspec.py | Updates internal import to use package-relative private. |
| pydiwasp/writespec.py | Adds writespec module under package. |
| pydiwasp/private/init.py | Defines private as a subpackage (docstring only). |
| pydiwasp/private/accs.py | Adds transfer functions for acceleration measurements. |
| pydiwasp/private/BDM.py | Adds Bayesian Directional Method implementation. |
| pydiwasp/private/check_data.py | Adds DIWASP data structure validation/utilities. |
| pydiwasp/private/DFTM.py | Adds Direct Fourier Transform Method implementation. |
| pydiwasp/private/diwasp_csd.py | Adds cross-spectral density helper. |
| pydiwasp/private/elev.py | Adds elevation transfer function. |
| pydiwasp/private/EMEP.py | Adds EMEP estimation method implementation. |
| pydiwasp/private/EMLM.py | Adds EMLM estimation method implementation. |
| pydiwasp/private/hsig.py | Adds significant wave height helper. |
| pydiwasp/private/IMLM.py | Adds IMLM estimation method implementation. |
| pydiwasp/private/pres.py | Adds pressure transfer function. |
| pydiwasp/private/slpx.py | Adds x-direction surface slope transfer function. |
| pydiwasp/private/slpy.py | Adds y-direction surface slope transfer function. |
| pydiwasp/private/smoothspec.py | Adds spectrum smoothing helper. |
| pydiwasp/private/spectobasis.py | Adds spectral unit conversion helper. |
| pydiwasp/private/vels.py | Updates import to be relative within private subpackage. |
| pydiwasp/private/velx.py | Adds x-velocity transfer function. |
| pydiwasp/private/vely.py | Adds y-velocity transfer function. |
| pydiwasp/private/velz.py | Adds vertical velocity transfer function. |
| pydiwasp/private/wavenumber.py | Adds wave number calculation helper. |
Comments suppressed due to low confidence (9)
pydiwasp/dirspec.py:19
dirspecselects the estimation algorithm viaeval(EP['method']), but onlyIMLMandEMEPare imported in this module. If a caller setsEP['method']to one of the other allowed values (DFTM,EMLM,BDMpercheck_data), this will raiseNameError. Import the missing methods into this module (or replaceevalwith an explicit dispatch map).
pydiwasp/dirspec.py:9- Import of 'velx' is not used.
pydiwasp/dirspec.py:10 - Import of 'vely' is not used.
pydiwasp/dirspec.py:11 - Import of 'pres' is not used.
pydiwasp/dirspec.py:12 - Import of 'elev' is not used.
pydiwasp/dirspec.py:13 - Import of 'vels' is not used.
pydiwasp/dirspec.py:14 - Import of 'accs' is not used.
Import of 'accz' is not used.
pydiwasp/dirspec.py:16 - Import of 'IMLM' is not used.
pydiwasp/dirspec.py:17 - Import of 'EMEP' is not used.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
|
@copilot fix based on review comments |
…ols-scm Co-authored-by: SBFRF <8375832+SBFRF@users.noreply.github.com>
SBFRF
approved these changes
Feb 10, 2026
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.
Repository Organization Refactoring - Complete ✅
This PR successfully refactors the pyDIWASP repository to follow traditional Python package structure, making it deployable, maintainable, and ready for PyPI distribution.
✅ Completed Tasks
pydiwasp/private/as a subpackage__init__.pyfiles📦 Package Structure Changes
Before:
After (Traditional Python Package):
🔄 Import Changes
Before:
After:
📝 Key Benefits
pip install -e .orpip install pyDIWASP(when published)from pydiwasp import dirspecinstead of direct file importspython -m buildandtwine upload✅ Verification
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.