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

Consistent namings for conversion functions #2039

Open
2 tasks done
Zeitsperre opened this issue Jan 10, 2025 · 0 comments
Open
2 tasks done

Consistent namings for conversion functions #2039

Zeitsperre opened this issue Jan 10, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@Zeitsperre
Copy link
Collaborator

Addressing a Problem?

This is a pet peeve of mine, with a very simple (albeit API-breaking) fix.

We currently offer several conversion tools that use the following naming conventions:

  • x2x:
    • amount2rate
    • flux2rate
    • lwethickness2amount
    • pint2cfattrs
    • pint2cfunits
    • rate2amount
    • rate2flux
    • str2pint
    • units2pint
  • x_to_x:
    • days_since_to_doy
    • doy_to_says_since
    • prsn_to_prsnd
    • prsnd_to_prsn
    • snw_to_snd
    • snd_to_snw
  • x_2_x:
    • sfcwind_2_uas_vas
    • uas_vas_2_sfcwind

Potential Solution

We agree on the following conventions:

  • xclim.core conversions that are typically used internally use the [a-z]+2[a-z] pattern.
  • xclim.indices | xclim.indicators conversions use the [a-z]+\_to\_[a-z] pattern.

Additional context

We can deprecate the sfcwind_2_uas_vas and uas_vas_2_sfcwind conversions now and replace them in the next two or three releases.

Contribution

  • I would be willing/able to open a Pull Request to contribute this feature.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Zeitsperre Zeitsperre added the enhancement New feature or request label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant