Skip to content
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

code refactor #31

Open
matt-long opened this issue Mar 7, 2020 · 1 comment
Open

code refactor #31

matt-long opened this issue Mar 7, 2020 · 1 comment

Comments

@matt-long
Copy link
Contributor

I am thinking about my OMWG talk...so this list is coming out of me right now. I think my refactor of the nutrient plotting tries to move towards some of these principles.

Principles

Rely on APIs for data access

  • Data access based on hard-coded paths is fragile
  • Sometimes, relationships between data and actual desired product involves computation
    • For instance, pop_tools.get_grid(...) reads CESM INPUTDATA files via web protocol and
      does the same computations as the model to derive the grid variables. Super portable. Efficient because of Numba!
  • Access details are messy
    • Simulations discretized over arbitrary number of files: time levels, variables, ensemble
      members: does not conform to meaningful conceptual discretization
    • Many file formats, temporal frequencies, spatial resolutions: APIs enable standardizations steps to be applied en route
  • An API can be parameterized
    • Flexibility enables more reuseable components
    • Build codes to perform operation over key dimension in query returns

Consume and produce xarray datasets

  • xarray.Dataset objects encapsulate data and metadata
  • i/o and Cloud storage formats are well supported
  • Operators enable rapid dimension reduction, interpolation, resampling, &

Plotting code should not do "computation"

  • Computation should be clearly separate from visualization
  • The data behind plots should be cached
  • If the data to make plots is available, we can build web-visualization maps around it

Isolate dependencies on glade

  • Data behind a authentication layers precludes reproducibility

To be continued....

@matt-long
Copy link
Contributor Author

How many local modules do we need?

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

No branches or pull requests

1 participant