-
Notifications
You must be signed in to change notification settings - Fork 0
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
New Fontend #71
base: main
Are you sure you want to change the base?
New Fontend #71
Conversation
@sehnem This looks like a good start. A couple of questions or pieces of feedback: About the problems:
About the gas optics:
|
Right now when the gas optics file is loaded in an xarray and the accessor
The problem has default source functions and I created some setters in case the user wants to change it (giving a new function of an array of the source), but I will change it to the gas optics and just return the default.
Using accessors we can have all the metadata and share dimensions, as you mentioned. I can transform the problem into an xarray with other accessor to do that.
This can be created, if we transform the problem into an xarray dataset it will have one by default.
I will rename it, will have to fix other things in the naming convention. A question about how the user will usually run the models. Here is my understanding, correct me if I am wrong.
The user will be able to change the accessor based on the current code and make it work as needed for any case, but I think that there are some common inputs that may need to be more flexible, what would be those inputs? I am asking to implement the methods needed to transform the input data. |
@brendancol @sehnem and I just had a chat. I explained that the gas optics classes are best viewed as a transformation between input data sets (temperature, pressure, gas concentrations) and problem definitions. The transformations are driven by data but users should have no interaction with that data. For this reason I wonder if the gas optics ought to be a class on its own, perhaps with a (hidden?) |
@sehnem had the idea that the gas optics transformations could return |
93c6afb
to
dba6066
Compare
4b106a4
to
d47a4df
Compare
@RobertPincus , this is an initial implementation of the frontend concept from issue #31.
It utilizes an
xarray
accessor that loads the NetCDF file and returns either anSWProblem
or anLWProblem
, depending on the file type.Once loaded, the problem allows for modification of certain variables.
The user can also create a standalone Problem if all the variables are provided.
The syntax for the SW case is as follows:
For the SW case, two parameters define the functions to compute
mu0
andtoa_flux
. Users can providetotal_solar_irradiance
andsolar_zenith_angle
values as shown in the example, set the variables directly with a numpy array, or even implement custom functions to compute these values.This approach may offer flexibility beyond immediate needs, but it provides a more adaptable implementation.
@tcmetzger, I closed the previous draft PR as its changes have been incorporated here, and it hadn’t resolved the issue. This PR also updates the tests, which are running successfully locally. The Conda fix will be required alongside these changes.