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

rename and move data maniplation functions #237

Closed
mathause opened this issue Dec 13, 2022 · 6 comments · Fixed by #274
Closed

rename and move data maniplation functions #237

mathause opened this issue Dec 13, 2022 · 6 comments · Fixed by #274
Milestone

Comments

@mathause
Copy link
Member

mathause commented Dec 13, 2022

edited the title after #274. The old title was rename the xarray_utils?


It's a bit a generic, bland name and does not say much. Also @jschwaab prefered something else. Worth reconsidering before v0.9.0

@mathause mathause added this to the v0.9.0 milestone Dec 13, 2022
@mathause mathause changed the title rename the xarray_utils rename the xarray_utils? Dec 13, 2022
@mathause
Copy link
Member Author

See #217 for ideas

@mathause
Copy link
Member Author

mathause commented Sep 1, 2023

My current idea is to make them "first level citizens" (not sure if this is the correct term), i.e.:

mesmer.grid
mesmer.mask
mesmer.weighted

mesmer.grid.wrap_to_180(...)
mesmer.mask.mask_ocean(...)
mesmer.weighted.global_mean(...)

where I would move the .py files to core and then import from there. I don't like to have them two levels down (mesmer.process.grid.stack(...)) and I don't know what a good name for the first level should be anyway.

@mathause
Copy link
Member Author

mathause commented Sep 1, 2023

Happy to reconsider if there is a better idea...

@mathause mathause reopened this Sep 4, 2023
@mathause mathause changed the title rename the xarray_utils? rename and move data maniplation functions Sep 4, 2023
@mathause mathause changed the title rename and move data maniplation functions rename the xarray_utils? Sep 4, 2023
@mathause mathause changed the title rename the xarray_utils? rename and move data maniplation functions Sep 4, 2023
@mathause
Copy link
Member Author

mathause commented Sep 4, 2023

After #274 I renamed this issue as I am not yet sure that the names are final (i.e. if I am totally happy with them). This concerns:

mesmer.mask.mask_ocean_fraction
mesmer.mask.mask_ocean
mesmer.mask.mask_antarctica

mesmer.globmean.lat_weights
mesmer.globmean.weighted_mean

mesmer.core.computation.calc_geodist_exact
mesmer.core.computation.gaspari_cohn
  • calc_geodist_exact, gaspari_cohn, and lat_weights could go to mesmer.geo or mesmer.geog.
  • mesmer.globmean.weighted_mean could be renamed to mesmer.weighted.global_mean. Or this could even go to mesmer.stats.weighted?
  • mesmer.mask could go to mesmer.region, or also to mesmer.region (I am not super happy having mask twice in a row (i.e. mesmer.mask.mask_ocean_fraction), but they could just as well stay...

I am happy with mesmer.grid:

mesmer.grid.wrap_to_180(...)
mesmer.grid.wrap_to_360(...)
mesmer.grid.stack_lat_lon(...)
mesmer.grid.unstack_lat_lon_and_align(...)
mesmer.grid.unstack_lat_lon(...)
mesmer.grid.align_to_coords(...)

@mathause
Copy link
Member Author

mathause commented Sep 6, 2023

  • mesmer.globmean certainly needs renaming
    • Move this to mesmer.weighted
    • Add a new function global_mean(da, weights=None, x_dim="lon", y_dim="lat") which calculates the lat weights if not given.
  • I recently thought of geospatial - so calc_geodist_exact could go to mesmer.geospatial.calc_geodist_exact
  • Need to think if I move e.g. "mesmer/core/grid.py" to "mesmer/grid.py". Organisation-wise I don't like it but sphinx-autosummary does not work well otherwise...

@mathause
Copy link
Member Author

closing in favor of #348

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 a pull request may close this issue.

1 participant