Skip to content

Suggested refactoring - type hinting, logging, & CLI.#23

Open
oj-tooth wants to merge 5 commits intoAmine-ouhechou:mainfrom
oj-tooth:main
Open

Suggested refactoring - type hinting, logging, & CLI.#23
oj-tooth wants to merge 5 commits intoAmine-ouhechou:mainfrom
oj-tooth:main

Conversation

@oj-tooth
Copy link

Hi Amine,

My name is Ollie Tooth, I'm an ocean modeller at the National Oceanography Centre in the UK.
I've recently been working with the synthocean package for the SWOT MIP project and noticed a few bug fixes / improvements that could be made to make life easier for users. I have implemented them in this PR and included the details below:

  • Added logging to replace print statements to update users on script progress.
  • Added type hinting and numpy docstrings.
  • Replaced selection of first time-step from model SSH input dataset with selection of the nearest time-step to the average time of the provided SWOT swath.
  • Refactored the argument parsing into separate function to be called from main() -> renamed model2swot().
  • Defined model2swot() as a [project.script] in the pyproject.toml file, so that once users have locally installed via pip (pip install -e .) the script can be called from the command line using model2swot -m .... -k ... etc.
  • Added details on installation and table of updated arguments to README.md
  • Added an example bash script on how to use the model2swot tool at scale: performing interpolation onto all available 2024 SWOT grids dataset linked in the Tips section using a 1/12 eORCA12 NEMO model. (No output files have been included, just a template of the procedure to select the appropriate files and perform the interpolation etc.)

Feel free to include / reject any of the above - creating this fork helped me learn how the tool was working behind the scenes and speed up my workflow for the SWOT MIP. This was done quite hastily, so I'm sure you can make lots of further improvements to my suggestions!

Thanks,

Ollie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant