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

Split "utility" functions from core functionality #282

Open
jagerber48 opened this issue Dec 30, 2024 · 0 comments
Open

Split "utility" functions from core functionality #282

jagerber48 opened this issue Dec 30, 2024 · 0 comments

Comments

@jagerber48
Copy link
Contributor

jagerber48 commented Dec 30, 2024

A few ideas have been identified that would be useful helper functions we could consider adding to uncertainties. It may be appropriate to collect these helpers into a single module, separated out from the core uncertainties code. The following functions are candidates for inclusion in this helpers module:

  • covariance_matrix - calculates the covariance matrix between a sequence of UFloat (could be renamed covariance_matrix_from_ufloats
  • correlation_matrix - calculates the correlation matrix between a sequence of UFloat (could be renamed correlation_matrix_from_ufloats
  • correlated_values - constructs a sequence of UFloat from a sequence of nominal values and a covariance matrix (should be renamed something like ufloats_from_covariance_matrix)
  • correlated_values_norm - constructs a sequence of UFloat from a sequence of tuples of values/standard deviations together with a correlation matrix. (Should be renamed something like ufloats_from_correlation_matrix
  • ufloat_from_sample_std_dev as discussed in Added ufloat_from_sample function #277
  • ufloat_from_sample_sem as discussed in Added ufloat_from_sample function #277
  • inverse_variance_weighted_mean as discussed in unumpy.average: init #265

Thoughts? Other candidates for this module? Also what should this module be called? uncertainties.utils or uncertainties.utilities are obvious candidates but there are admonishments like https://breadcrumbscollector.tech/stop-naming-your-python-modules-utils/ to avoid naming modules that way. Honestly, despite the admonishments the utils.name seems fine to me in this case unless there's a better idea.

@jagerber48 jagerber48 mentioned this issue Dec 30, 2024
5 tasks
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