You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working with TAMOC, I have had a number of ideas about code strucutre, etc -- Im lumping them all here so I won't forget. If you want to do any of these, we could start a new issue to discuss (or just do it :-).
numpy warnings
newer numpy raises a lot of warnings on FP operations by default -- it can be pretty annoying, particularly in a Jupyter Notebook. I suppressed a few in the PR: #24, but a more holistic approach would be beter. Options:
turn the warnings off in init.py (maybe optionally)
use the context manager to turn them off each time they occur, only for those places where it's know to expect them.
suggest that users turn them off at the top of their script / notebook -- I haven't tried that yet, but it should work.
This would make it much easier to write DRY (Don't repeat yourself) code -- by passing axesobjects around to code that has to do the same thing to multiple plots, etc.
DRY out the code
There is a lot of repeated MPL code -- if you have multipel figures / axes that share the same style, etc, you can write a function to set al that up, and call it with different axes objects from various places. (this will be esier with the OO interface above)
return Figure objects to platting calls
If a call to plot something returns a Figure object, then client code can use that to resize teh figure, save it out, etc. That would make it easier ot have a nice interactive Notebook that also genetaed figures for use elsewhere.
Use gsw
The gsw package provided state of teh art equation of staet for seawater: https://pypi.org/project/gsw/
There's probably no need for that level of precision in TAMOC, but it's nice to have code that someone else has maintained an tested. It's installable via PyPI and conda-forge
While working with TAMOC, I have had a number of ideas about code strucutre, etc -- Im lumping them all here so I won't forget. If you want to do any of these, we could start a new issue to discuss (or just do it :-).
numpy warnings
newer numpy raises a lot of warnings on FP operations by default -- it can be pretty annoying, particularly in a Jupyter Notebook. I suppressed a few in the PR: #24, but a more holistic approach would be beter. Options:
MPL structure
use MPL's OO API
It could be helpful to refactor a lot of the platting code to use MPL's "OO api" -- using the axes object, rather than pyplot's state machine /
gca
, etc (https://matplotlib.org/matplotblog/posts/pyplot-vs-object-oriented-interface/).This would make it much easier to write DRY (Don't repeat yourself) code -- by passing axesobjects around to code that has to do the same thing to multiple plots, etc.
DRY out the code
There is a lot of repeated MPL code -- if you have multipel figures / axes that share the same style, etc, you can write a function to set al that up, and call it with different axes objects from various places. (this will be esier with the OO interface above)
return Figure objects to platting calls
If a call to plot something returns a Figure object, then client code can use that to resize teh figure, save it out, etc. That would make it easier ot have a nice interactive Notebook that also genetaed figures for use elsewhere.
Use gsw
The gsw package provided state of teh art equation of staet for seawater:
https://pypi.org/project/gsw/
There's probably no need for that level of precision in TAMOC, but it's nice to have code that someone else has maintained an tested. It's installable via PyPI and conda-forge
use NUCOS
NOAA's uit converter is pretty handy:
https://pypi.org/project/pynucos/
https://github.com/NOAA-ORR-ERD/PyNUCOS
also on conda-forge (conda install pynucos)
Balance between another dependency and something with a lot of units that tested an maintained by others (and has weird-ass units like API Gravity)
The text was updated successfully, but these errors were encountered: