Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organize Helpers and Project Structure #370

Merged
merged 20 commits into from
Jul 21, 2023
Merged

Organize Helpers and Project Structure #370

merged 20 commits into from
Jul 21, 2023

Conversation

philipc2
Copy link
Member

@philipc2 philipc2 commented Jul 10, 2023

Closes #291, #247, #101, #86

Overview

  • Project structure has been refactored, splitting the Grid into a separate directory with specific modules that contain Grid-Only functionality.
  • Helper functions have been organized out of utils.helpers into specific modules
  • General refactoring (cleaning up imports, organizing functions in terms of Pubic vs Private in each file, etc)

Original Project Structure

.
├── ...
├── core                    
│   ├── api.py               # API
│   └── dataarray.py         # Dataarray Object
│   └── dataset.py           # Dataset Object
│   └── grid.py              # Grid Object
├── io                       
│   ├── _ugrid.py            # UGRID I/O
│   └── _exodus.py           # Exodus I/O
│   └── _mpas.py             # MPAS I/O
│   └── _scrip.py            # Scrip I/O
│   └── _shapefile.py        # Shapefile I/O
├── utils                     
│   ├── constants.py             # Top-Level constants 
│   └── get_quadratureDG.py      # Functions working with connectivity variables
│   └── helpers.py               # Assorted helper functions from all modules

New Project Structure

.
├── ...
├── core                     
│   ├── api.py               # API
│   └── dataarray.py         # Dataarray Object
│   └── dataset.py           # Dataset Object
├── grid                     
│   ├── grid.py              # Grid Object
│   └── connectivity.py      # Functions working with connectivity variables
│   └── coordinates.py       # Functions working with coordinates
│   └── area.py              # Functions working with face area
├── io                       
│   ├── _ugrid.py            # UGRID I/O
│   └── _exodus.py           # Exodus I/O
│   └── _mpas.py             # MPAS I/O
│   └── _scrip.py            # Scrip I/O
│   └── _shapefile.py        # Shapefile I/O
│   └── utils.py             # General I/O helpers
└── constants.py             # Top-Level constants 
├── utils   # General Helper Functions

PR Checklist

General

  • An issue is linked created and linked
  • Add appropriate labels
  • Filled out Overview and Expected Usage (if applicable) sections

Documentation

  • Docstrings have been added to all new functions
  • Docstrings have updated with any function changes
  • Internal functions have a preceding underscore (_) and have been added to docs/internal_api/index.rst
  • User functions have been added to docs/user_api/index.rst

@philipc2 philipc2 self-assigned this Jul 10, 2023
@philipc2 philipc2 linked an issue Jul 14, 2023 that may be closed by this pull request
@philipc2 philipc2 added documentation Improvements or additions to documentation new feature New feature or request labels Jul 17, 2023
@philipc2 philipc2 changed the title DRAFT: Organize Helpers and Project Structure Organize Helpers and Project Structure Jul 17, 2023
@philipc2 philipc2 marked this pull request as ready for review July 17, 2023 16:42
Copy link
Collaborator

@ifranda ifranda left a comment

Choose a reason for hiding this comment

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

This looks good as far as I can tell!

uxarray/utils/numba.py Outdated Show resolved Hide resolved
@rajeeja
Copy link
Contributor

rajeeja commented Jul 21, 2023

@philipc2
Copy link
Member Author

API docs seem to be broken: https://uxarray--370.org.readthedocs.build/en/370/user_api/index.html

Will fix this.

@philipc2
Copy link
Member Author

@anissa111

Would you have an idea to why the API isn't rendering?

@philipc2
Copy link
Member Author

@rajeeja

Documentation is fixed now.

@rajeeja
Copy link
Contributor

rajeeja commented Jul 21, 2023

where do you think the Analysis Operators would go?
in core - based on if they operate on dataset or dataarray etc?

integrate currently resides in dataset.py..

@rajeeja
Copy link
Contributor

rajeeja commented Jul 21, 2023

good work overall, helpers.py was getting cumbersome and this organization is better than the previous one.

@rajeeja rajeeja merged commit 7f59006 into main Jul 21, 2023
10 checks passed
@philipc2
Copy link
Member Author

where do you think the Analysis Operators would go? in core - based on if they operate on dataset or dataarray etc?

integrate currently resides in dataset.py..

Correct, I envision that operators that interface with both the data and grid will be housed under the core directory, with grid being used for functions that only operate on the grid and it's geometry/topology.

@erogluorhan erogluorhan deleted the philipc2/refactor branch August 11, 2023 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation new feature New feature or request
Projects
None yet
4 participants