Comments (7)
Did you already implement a fix for this issue? https://github.com/csyhuang/hn2016_falwa/blob/master/hn2016_falwa/xarrayinterface.py#L299 looks like it does the trick and ylat_output
just needs to be used in the rest of the method. Is there something else to do?
We could alternatively keep all the logic in QGField
and introduce a companion to get_latitude_dim
that always returns the appropriate latitude coordinates. Do you have a preference?
from hn2016_falwa.
It looks like I am going to rewrite/reorganize the dimension, shape and metadata generation of the xarrayinterface with the implementation of a dask-aware QGDataset
for #50. I will address this issue at the same time, most likely by introducing a new ylat_interpolated
(I'll check again what would be most consistent with the existing variable naming) property to QGField
that always provides the appropriate latitude coordinates.
from hn2016_falwa.
@chpolste Thanks for taking care of this! I am thinking if this would be a better solution: rename self.ylat
inside QGField to self._ylat
such that it is for internal usage only. Users shall only be able to access the input latitude grid saved as self._ylat_input
at the beginning. To keep the external interface the same, we can do something like
@property
def ylat(self):
return self._ylat_input
Since all the computed field will be interpolated onto self._ylat_input
when being access, on the user end, everything is consistent. Let me know what you think about this.
Besides that, there is another procedure in QGDataset
which I wonder if you may change: instead of doing _map_collect
to collect the output arguments from the method, would it be possible to get the computed quantities directly from the QGField
object? Instead of
# Call interpolate_fields on all QGField objects
out_fields = _map_collect(
lambda field: field.interpolate_fields(),
self._fields,
["qgpv", "interpolated_u", "interpolated_v", "interpolated_theta", "static_stability"],
postprocess=np.asarray
)
Is it possible to get directly from each field
object field.qgpv
, field.interpolated_u
, field.interpolated_v
etc.? In this way, we can disentangle the dependency of QGDataset
to the interface of the methods of QGField
.
In the near future, I want to eliminate the returning of processed arguments in the 3 public methods of QGField
to save some computation time and speed up procedures in MDTF - In the MDTF use case, for the first iteration, I want to get only Uref
, Qref
, u_baro
and lwa_baro
. We can save time skipping the axes swap and interpolation for other quantities.
Let me know what you think is pragmatic in the given time frame. If that's too much to change, we can do the second part in another release. 😃 Thanks a lot!
from hn2016_falwa.
@chpolste For the suggested changes I mentioned above (use self._input_ylat
and self._ylat
inside QGField
), I did the changes on the branch csyhuang-refactor-oopinterface-ylat
:
The unit tests all pass so it should be working properly. If you think the changes look OK, you can start from there when working on QGDataset
such that no changes is needed in QGField
.
Let me know what you think 😃 Thanks for taking care of this!
from hn2016_falwa.
@chpolste For the suggested changes I mentioned above (use
self._input_ylat
andself._ylat
insideQGField
), I did the changes on the branchcsyhuang-refactor-oopinterface-ylat
:The unit tests all pass so it should be working properly. If you think the changes look OK, you can start from there when working on
QGDataset
such that no changes is needed inQGField
.
Perfect, thanks!
Besides that, there is another procedure in
QGDataset
which I wonder if you may change: instead of doing_map_collect
to collect the output arguments from the method, would it be possible to get the computed quantities directly from theQGField
object? Instead of# Call interpolate_fields on all QGField objects out_fields = _map_collect( lambda field: field.interpolate_fields(), self._fields, ["qgpv", "interpolated_u", "interpolated_v", "interpolated_theta", "static_stability"], postprocess=np.asarray )Is it possible to get directly from each
field
objectfield.qgpv
,field.interpolated_u
,field.interpolated_v
etc.? In this way, we can disentangle the dependency ofQGDataset
to the interface of the methods ofQGField
.In the near future, I want to eliminate the returning of processed arguments in the 3 public methods of
QGField
to save some computation time and speed up procedures in MDTF - In the MDTF use case, for the first iteration, I want to get onlyUref
,Qref
,u_baro
andlwa_baro
. We can save time skipping the axes swap and interpolation for other quantities.
Sounds good. Branch xr-delayed up to a26b150 implements this, with _map_collect
completely removed from the codebase. No pull request yet, as I will continue working on the branch to implement dask support. I need a lot of the new metadata support for that anyway.
from hn2016_falwa.
@chpolste : 👍 Awesome! I finally got a chance to test the code with MDTF calculations! Your updated version of QGDataset
works seamlessly and saves me lines of code. Thanks a lot for the adjustment! 😄
FYI, I'll keep working from my new branch csyhuang-from-xr-delayed-ua2-fix
which branches from your commit a26b150. I've just touched base with Noboru - the bugfix for zonal advective flux from the cosine weighting error you spotted out will be added on that branch. We will write up an Issue about this bugfix in a day or two.
My hope is to wrap all these up by this weekend (Nov 5): (1) bugfix for advective flux, (2) falwa release v1.0, (3) MDTF pull request, and (4) the Geoscience Data Journal paper (70% finished), hopefully not too ambitious 🙈 . I think you've finished your share of work for (1)-(3) so let me wrap up the final part of relay. I'll send you (4) to comment after I finish (hopefully soon). Thanks a lot!
from hn2016_falwa.
Christopher has addressed this issue in commits up to a26b150 so this can be closed
from hn2016_falwa.
Related Issues (20)
- Automate deployment onto PyPI via GitHub workflow
- Issue in reference state calculations for model data HOT 1
- A potential bug in the 'u_baro' calculation of FALWA v.1.2.0 HOT 2
- Add diabatic heating in the LWA budget
- Issues with deployment onto conda channel HOT 2
- Issues deploying package to PyPI channel HOT 1
- Diagnostics (+ interpretations) to incorporate into MDTF
- Research into Scikit-build solution for F2PY
- Incorporate listed diagnostic to MDTF and submit pull request
- Bug in GitHub action
- IMPORTANT bugfix release 0.7.2 + corrigendum HOT 3
- Use Cartopy instead of Basemap (deprecated) in all the visualization examples
- Provide the option to compute QGPV from relative vorticity in QGFIeld
- Compute vertically averaged local non-conservative force contribution
- Rename the python package to falwa for release v1.0.0 HOT 1
- IMPORTANT: Code error in calculating advective flux in bug fix release 0.7.2
- Vertical coordinate conversions HOT 3
- numpy.disutils will deprecate for python 3.12
- Bug in processing latitude grid that does not include equator
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hn2016_falwa.