https://github.com/cyrraz/logscale

Compute orders of magnitude

https://github.com/cyrraz/logscale

Science Score: 26.0%

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

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (5.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Compute orders of magnitude

Basic Info
  • Host: GitHub
  • Owner: cyrraz
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Size: 25.4 KB
Statistics
  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • Open Issues: 1
  • Releases: 1
Created 11 months ago · Last pushed 10 months ago
Metadata Files
Readme License

README.md

logscale

This Python package provides a single function, order_of_magnitude(), which computes and returns the order of magnitude of a given number in a standardized string format.

The order of magnitude gives a compact representation of a number as a product of a coefficient and a power of 10, where the coefficient is constrained to lie within the interval [1/√10, √10). For more information, see the wikipedia article on orders of magnitude.

Installation

If you are using uv, you can install the package from PyPI with:

uv pip install logscale

Alternatively, with regular pip:

pip install logscale

Examples

```python from logscale import orderofmagnitude

orderofmagnitude(129) # "1.3e2" orderofmagnitude(0.0001) # "1.0e-4" orderofmagnitude(456) # "0.46e3" orderofmagnitude(70.2) # "0.70e2" orderofmagnitude(0) # "0.0e0" ```

Owner

  • Name: Cyrille Praz
  • Login: cyrraz
  • Kind: user
  • Location: Switzerland / Japan

PhD | Data Scientist | Experimental Physicist

GitHub Events

Total
  • Release event: 1
  • Push event: 4
  • Create event: 3
Last Year
  • Release event: 1
  • Push event: 4
  • Create event: 3

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 47 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
pypi.org: logscale

Compute orders of magnitude

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 47 Last month
Rankings
Dependent packages count: 8.8%
Average: 29.0%
Dependent repos count: 49.3%
Maintainers (1)
Last synced: 10 months ago

Dependencies

.github/workflows/cd.yaml actions
  • actions/checkout v4 composite
  • actions/download-artifact v4 composite
  • actions/upload-artifact v4 composite
  • astral-sh/setup-uv v6 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/ci.yaml actions
  • actions/checkout v4 composite
  • astral-sh/setup-uv v6 composite
.github/workflows/pr.yaml actions
  • amannn/action-semantic-pull-request v5 composite
pyproject.toml pypi