-
Notifications
You must be signed in to change notification settings - Fork 16
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
Questions about mocsy use and packaging #2
Comments
Regarding packing Fortran in Python, I have used f2py for mocsy. More recently, i have switched to 'f90wrap' (also available on github) for a yet to be released, updated version of mocsy. Are you suggesting to use something else? The new version mocsy will allow the user to compute the first derivatives of all output variables of the 'vars' routine (e.g., pCO2, pH, CO32-, saturation states) with respect to each input variable (DIC, Alkalinity, temperature, salinity, total phosphorus, total silicon). These first derivatives are also called sensitivities or buffer factors. In addition, the new version of mocsy will provide error propagation. |
@ocefpaf, thanks for your follow ups. I have no experience with f2py, so I have nothing to contribute directly, other than testing to confirm that the docstrings become accessible from Python. Regarding your two options:
I also have no useful opinion there, since I can't help with option 2. Regarding your intent to create unit tests, that sounds great. I'm happy to help, but not until the week after this one (I'll be traveling in meetings all week). I think we can plan on keeping the notebooks as additional user help and documentation, and your unit tests, well, for unit/code testing. @jamesorr, great to hear about the upcoming enhancements to mocsy. Thanks also for your detailed responses. I don't have much to add to what Filipe has said. I'm really glad you liked the notebook. We can refine it later and add it to your github repository when it's finalized. |
I use I will take a look how to do this with
Sounds awesome! I am not a CO2 guy. I am here just to help get it packaged, but some people around me are really exited about these additions. When you say |
Regarding the new version of mocsy, I haven't yet put in on github because we are still developing and testing it (with my colleague Jean-Marie Epitalon). It may be another month or two before it is available. es is with dual-number automatic differentiation, which is as accurate as the analytical solution. When it is updated, I'll probably put it on the master branch. |
Thanks for the info! That should not affect the efforts to package mocsy. I just finished reading f90wrap page on GitHub and I do not believe it will help with packing. It does create the Python module automatically but, as a Python guy, I dislike all those auto-generated classes. To package with f90wrap one would need to run f90wrap first, then f2py, and create a packaged based on the compiled module and python generated files. Those steps seems to add a layer of complexity that With that said, from a technical (and packaging biased) point of view, I do not recommend using f90wrap. Unless mocsy needs some of the unique features of f90wrap. I believe we have more flexibility to improve the user experience by writing some thin Python wrapper-functions to the Fortran functions. Or at least just provide a direct access like this. Either way, the current form of copying all the Fortran code into 1 file is not acceptable. I will re-write the |
@ocefpaf, let me know how I can help with this. I think I should be able to pitch in a bit. Besides, that will help me learn more about the wrapping and how you create the conda recipes. But, not until next week, when I'm back home from meetings ... |
Sure. I am a little bit swamped these days too. Lot of work in my day job and I am moving to a new place. I will be out for a while. |
Getting back to mocsy ... @ocefpaf, I noticed that you recently looked at options for better fortran wrapping. Have you been able to research this further? Earlier you wrote:
Do you anticipate us being able to make some progress on this in the near future? One thing I'd look forward to (and can offer to help, if you tell me how) is having access from Python to the rich doc strings for each function, as currently found in the Fortran modules. And of course, being able to work directly/automatically off of @jamesorr's master code, to accommodate updates easily. One small update I can report is that I've edited my mocsy_examples ipython notebook to remove the incorrect statements about suspicious pCO2 results. In Thanks. Off to AGU on Monday, for the whole week. But I can work on this while at AGU, if we can coordinate! |
It is relatively easy to do. I just could not find the time. (I have am important SECOORA deadline for January.) I will be able to get back to this during the holidays. |
Great to hear! Good luck with your SECOORA work. No rush.
|
xref: ioos/conda-recipes#563 (comment)
@jamesorr answer to some of the questions @emiliom and @ocefpaf raised while packaging
mocsy
.That is good to know. Thanks! In my simple mind I would just update everything.
In that regard I want to convert the webpage notebooks to unittests to lower the bar for future
mocsy
development. @jamesorr I will do that in a separate PR ASAP.Don't worry to much about that. If we go start writing wrapping functions in Python we might want to avoid the automatic generated docstrings. (The main reason behind this would be to use sphinx to generate docs from the docstrings.)
That is fine. (Although I would like to see a comparison of what would break just for the sake if curiosity.)
With that being said we have a decision to make. I was lazy in the packaging PR #1 and I copied all l the Fortran code into a single file. Since the design is ONLINE computation that single file is probably not OK.
Solutions:
(1) Is hackish, but easy. I am not sure if I can do (2), although that is probably the better way.
I will read more about packing Fortran modules in Python and come up with a better solution for this. Meanwhile let's avoid merging #1.
The text was updated successfully, but these errors were encountered: