-
Notifications
You must be signed in to change notification settings - Fork 10
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
Standardizing module import method for pyFV3 #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff. I'd drop the test
one, what do you think?
@@ -0,0 +1,28 @@ | |||
from .a2b_ord4 import AGrid2BGridFourthOrder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Poking @oelbert : an idea here. If we put down some one/two liner to explicitly describe each Module scientific purpose it may look nice in the docs. To be tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably a good idea, something like?
""" Converts a field from the Arakawa A grid to B grid """
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we have to generate the docs and see how it shows
tests/mpi/__init__.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to package the sub-directories of the test? Those are more end-user files, with no real API to publicize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's unnecessary, but if MSD wants to package the tests I won't object too strongly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no immediate need or reason to package them. I have been adding __init__
where they aren't for anything that looks like it can/might have a reason to have one.
@@ -1 +1,3 @@ | |||
from .analytic_init import init_analytic_state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like in stencils
this might be a good place for some cursory scientific description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good to me
Please merge in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple of docstrings that should be clarified, and there's a lot more exposed in the pyFV3 init than I thought we'd agreed on?
pyFV3/__init__.py
Outdated
from .stencils import ( | ||
AcousticDynamics, | ||
AdjustNegativeTracerMixingRatio, | ||
CGridShallowWaterDynamics, | ||
DGrid2AGrid2CGridVectors, | ||
DivergenceDamping, | ||
DryConvectiveAdjustment, | ||
DynamicalCore, | ||
FiniteVolumeFluxPrep, | ||
FiniteVolumeTransport, | ||
HyperdiffusionDamping, | ||
LagrangianToEulerian, | ||
NonhydrostaticVerticalSolver, | ||
NonhydrostaticVerticalSolverCGrid, | ||
PK3Halo, | ||
RayleighDamping, | ||
SatAdjust3d, | ||
TracerAdvection, | ||
UpdateGeopotentialHeightOnCGrid, | ||
UpdateHeightOnDGrid, | ||
XPiecewiseParabolic, | ||
YPiecewiseParabolic, | ||
) | ||
from .testing import ( | ||
TranslateDycoreFortranData2Py, | ||
TranslateDynCore, | ||
TranslateFVDynamics, | ||
) | ||
from .wrappers import GeosDycoreWrapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we weren't going to expose the stencil classes or test code or wrapper at this level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testing
definitely not.
stencils
we can discuss. DynamicalCore
needs to be exposed or else Pace
can't do anything really, the other could be hidden if we consider them not re-usable.
wrappers
needs to be exposed, it's public API.
Co-authored-by: Oliver Elbert <[email protected]>
…to feature/init_standard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor note about exposing wrappers, but not blocking
pyFV3/__init__.py
Outdated
from .stencils.fv_subgridz import DryConvectiveAdjustment | ||
from .wrappers.geos_wrapper import GeosDycoreWrapper | ||
from .stencils import DryConvectiveAdjustment, DynamicalCore | ||
from .wrappers import GeosDycoreWrapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not totally convinced we want to expose the wrappers here, but it's probably ok with just the GEOS wrapper, though I may want to revisit if it starts getting unwieldy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair opposition.
Technically a Wrapper is so bespoke it's a bit of a stretch for me to call it a "public" API. I wouldn't object to removing it.
I might in the future take it off pyFV3
entirely and move it to GEOS itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Description
Adding
__init__
files to standardize import method of modulesHow Has This Been Tested?
Tested via lint and currently implemented translate tests
OS: RHEL 8.9 Ootpa
Built conda environment using workflow in github action configurations
Checklist: