metrolopy

Tools for uncertainty propagation and measurement unit conversion — Outils pour la propagation des incertitudes et la conversion d'unités de mesure

https://github.com/nrc-cnrc/metrolopy

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary

Keywords

curve-fitting error-propagation ipython jupyter metrology monte-carlo-simulation python3 uncertainties uncertainty uncertainty-analysis uncertainty-propagation uncertainty-visualisation unit-conversion unit-converter
Last synced: 4 months ago · JSON representation ·

Repository

Tools for uncertainty propagation and measurement unit conversion — Outils pour la propagation des incertitudes et la conversion d'unités de mesure

Basic Info
Statistics
  • Stars: 35
  • Watchers: 8
  • Forks: 6
  • Open Issues: 3
  • Releases: 16
Topics
curve-fitting error-propagation ipython jupyter metrology monte-carlo-simulation python3 uncertainties uncertainty uncertainty-analysis uncertainty-propagation uncertainty-visualisation unit-conversion unit-converter
Created almost 7 years ago · Last pushed 4 months ago
Metadata Files
Readme License Citation

README.md

MetroloPy

tools for dealing with physical quantities: uncertainty propagation and unit conversion


MetroloPy is a pure python package and requires Python 3.6 or later and the SciPy stack (NumPy, SciPy and Pandas). It looks best in a Jupyter Notebook.

Install MetroloPy with pip install metrolopy or conda install -c conda-forge metrolopy.

Physical quantities can then be represented in Python as gummy objects with an uncertainty and (or) a unit:

>>> import metrolopy as uc
>>> a = uc.gummy(1.2345,u=0.0234,unit='cm')
>>> a
1.234(23) cm

>>> b = uc.gummy(3.034,u=0.174,unit='mm')
>>> f = uc.gummy(uc.UniformDist(center=0.9345,half_width=0.096),unit='N')
>>> p = f/(a*b)
>>> p
2.50(21) N/cm2

>>> p.unit = 'kPa'
>>> p.uunit = '%'
>>> p
25.0 kPa ± 8.5%

MetroloPy can do much more including Monte-Carlo uncertainty propagation, generating uncertainty budget tables, and curve fitting. It can also handle expanded uncertainties, degrees of freedom, correlated quantities, and complex valued quantities. See:

new in version 1.0.0

  • The calculation of effective degrees of freedom has been improved. In previous versions, in a multi-step calculation, the effective degree of freedom were calculated at each step based on the degrees of freedom calculated for the previous step (using a modified Welch-Satterthwaite approximation). Now effective degrees of freedom are always calculated directly from the independent variables using the Welch-Satterthwaite equation.

  • CODATA 2022 values instead of 2018 values are used in the Constants module.

  • The significance value in budget table has been redefined from (sensitivity coefficient * standard uncertainty/combined uncertainty) to the square of that value so that the significance values in a budget sum to one.

  • Units can now be raised to a fractional power and many other bug fixes.

new in version 0.6.0

  • A constant library has been added with physical constants that can be accessed by name or alias with the constant function. The search_constants function with no argument gives a listing of all built-in constants. Each constant definition includes any correlations with other constants.

  • The Quantity class has been added to represent a general numerical value multiplied by a unit and the unit function has been added to retrieve Unit instances from the unit library by name or alias. Unit instances can now be multiplied and divided by other Unit instances to produce composite units, can be multiplied and divided by numbers to produce Quantity instances or multiply or divide Quantity instances. The gummy class is now a subclass of Quantity with a nummy value rather than a subclass of nummy. A QuantityArray class has been introduced to represent an array of values all with the same unit. Multiplying a Unit instance by a list, tuple, or numpy array produces a QuantityArray instance.

  • The immy class has been introduced as an ummy valued counterpart of the jummy class for representing complex values with uncertainties. immy and jummy values can now be displayed in a polar representation in addition to a cartesian representation. immy and jummy .r and .phi properties have been added to access the magnitude and argument of the values as a complement to the .real and .imag properties.

Owner

  • Name: National Research Council of Canada — Conseil national de recherches du Canada
  • Login: nrc-cnrc
  • Kind: organization
  • Email: info@nrc-cnrc.gc.ca
  • Location: Canada

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Parks"
  given-names: "Harold V."
title: "MetroloPy"
version: 1.0.1
doi: 10.5281/zenodo.17049334
date-released: 2025-09-03
url: "https://github.com/nrc-cnrc/MetroloPy"

GitHub Events

Total
  • Create event: 5
  • Release event: 2
  • Issues event: 3
  • Watch event: 2
  • Delete event: 1
  • Issue comment event: 1
  • Push event: 16
  • Pull request event: 4
Last Year
  • Create event: 5
  • Release event: 2
  • Issues event: 3
  • Watch event: 2
  • Delete event: 1
  • Issue comment event: 1
  • Push event: 16
  • Pull request event: 4

Committers

Last synced: almost 2 years ago

All Time
  • Total Commits: 200
  • Total Committers: 3
  • Avg Commits per committer: 66.667
  • Development Distribution Score (DDS): 0.215
Past Year
  • Commits: 4
  • Committers: 1
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
hvparks 4****s@u****m 157
harold h****s@n****a 42
Frederic Tessier f****r@u****m 1
Committer Domains (Top 20 + Academic)
nrc.ca: 1

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 25
  • Total pull requests: 22
  • Average time to close issues: 11 months
  • Average time to close pull requests: 1 minute
  • Total issue authors: 12
  • Total pull request authors: 1
  • Average comments per issue: 1.96
  • Average comments per pull request: 0.05
  • Merged pull requests: 22
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 8
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 minute
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • vysiker (6)
  • hvparks (4)
  • nluetts (3)
  • fookatchu (3)
  • userJay (2)
  • daharn (1)
  • heikowestermann (1)
  • Pablofero (1)
  • YanLiang1102 (1)
  • ry-dgel (1)
  • JensReimann (1)
  • willynilly (1)
Pull Request Authors
  • hvparks (22)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 391 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 21
  • Total maintainers: 1
pypi.org: metrolopy

tools for dealing with measured quantities: uncertainty propagation and unit conversion

  • Versions: 16
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 391 Last month
Rankings
Dependent packages count: 10.1%
Stargazers count: 11.5%
Forks count: 13.3%
Average: 15.0%
Downloads: 18.4%
Dependent repos count: 21.5%
Maintainers (1)
Last synced: 4 months ago
conda-forge.org: metrolopy

A pure python package with tools for handling first order and Monte-Carlo propagation of uncertainty; handles relative, absolute, and expanded uncertainties of quantities with units.

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 34.0%
Stargazers count: 43.4%
Average: 43.6%
Forks count: 46.0%
Dependent packages count: 51.2%
Last synced: 4 months ago

Dependencies

setup.py pypi
  • matplotlib *
  • numpy >=1.13
  • pandas *
  • scipy *