miniufo / xinvert

Invert geophysical fluid dynamic problems (elliptic partial differential equations) using SOR iteration method.
https://xinvert.readthedocs.io/
MIT License
40 stars 15 forks source link

Dependence on xcontour package #23

Closed NoraLoose closed 1 year ago

NoraLoose commented 1 year ago

I'm opening a new issue here to continue the discussion on the issue of the xcontour dependence that we started here.

The dependence of xcontour is a bit complicated. It is another package I've written here. So the example of reference state, which is newly added, depends on xcontour to prepare the forcing (actually preparing the forcing data is not the core part of xinvert). This is not necessary for other examples. So far, I don't have any plan to get xcontour released as a conda package, so it is not possible to add this to conda dependency. Do you have any suggestion? I really like this example to remain in the problem list.

Is there a way to precompute M(Q) and C(Q) with xcontour and in the https://xinvert.readthedocs.io/en/latest/notebooks/05_reference_SWM.html example, and just load these states from netcdf if xcontour is not available? You could then adapt the notebook as follows:

try:
    import xcontour
    # do xcontour computation in this notebook, as you do now
except ImportError:
    ds = xr.open_dataset(your_precomputed_dataset)

This is part of the review process at https://github.com/openjournals/joss-reviews/issues/5510.

miniufo commented 1 year ago

Oh yes, that's a nice workaround. I should do this follow your suggestion.

miniufo commented 1 year ago

It is fixed now at here

NoraLoose commented 1 year ago

Great! I'm closing this issue.