Science Score: 54.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
1 of 39 committers (2.6%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.5%) to scientific vocabulary
Keywords
Repository
The quantities and units library for C++
Basic Info
- Host: GitHub
- Owner: mpusz
- License: mit
- Language: C++
- Default Branch: master
- Homepage: https://mpusz.github.io/mp-units/
- Size: 39.1 MB
Statistics
- Stars: 1,232
- Watchers: 36
- Forks: 104
- Open Issues: 69
- Releases: 16
Topics
Metadata Files
README.md
mp-units - The quantities and units library for C++
The mp-units library might be the subject of ISO standardization for C++29. More on this can be found in the following ISO C++ proposals:
- P1935: A C++ Approach to Physical Units,
- P2980: A motivation, scope, and plan for a quantities and units library,
- P3045: Quantities and units library.
We are actively looking for parties interested in field-trialing the library.
Documentation
An extensive project documentation can be found on mp-units GitHub Pages. It includes installation instructions and a detailed user's guide.
TL;DR
mp-units is a compile-time enabled Modern C++ library that provides compile-time dimensional
analysis and unit/quantity manipulation.
Here is a small example of possible operations:
```cpp
include
using namespace mpunits; using namespace mpunits::si::unit_symbols;
// simple numeric operations static_assert(10 * km / 2 == 5 * km);
// conversions to common units staticassert(1 * h == 3600 * s); staticassert(1 * km + 1 * m == 1001 * m);
// derived quantities staticassert(1 * km / (1 * s) == 1000 * m / s); staticassert(2 * km / h * (2 * h) == 4 * km); static_assert(2 * km / (2 * km / h) == 1 * h);
static_assert(2 * m * (3 * m) == 6 * m2);
static_assert(10 * km / (5 * km) == 2 * one);
static_assert(1000 / (1 * s) == 1 * kHz); ```
Try it on the Compiler Explorer.
This library heavily uses C++20 features (concepts, classes as NTTPs, ...). Thanks to them the user gets a powerful but still easy to use interfaces and all unit conversions and dimensional analysis can be performed without sacrificing on runtime performance or accuracy. Please see the below example for a quick preview of basic library features:
```cpp
include
include
include
include
include
include
include
using namespace mp_units;
constexpr QuantityOfisq::speed auto avg_speed(QuantityOfisq::length auto d, QuantityOfisq::time auto t) { return d / t; }
int main() { using namespace mpunits::si::unitsymbols; using namespace mpunits::international::unitsymbols;
constexpr quantity v1 = 110 * km / h;
constexpr quantity v2 = 70 * mph;
constexpr quantity v3 = avgspeed(220. * isq::distance[km], 2 * h);
constexpr quantity v4 = avgspeed(isq::distance(140. * mi), 2 * h);
constexpr quantity v5 = v3.in(m / s);
constexpr quantity v6 = valuecast
std::cout << v1 << '\n'; // 110 km/h std::cout << std::setw(10) << std::setfill('') << v2 << '\n'; // *70 mi/h std::cout << std::format("{:^10}\n", v3); // 110 km/h std::println("{:%N in %U of %D}", v4); // 70 in mi/h of LT⁻¹ std::println("{::N[.2f]}", v5); // 30.56 m/s std::println("{::N[.2f]U[dn]}", v6); // 31.29 m⋅s⁻¹ std::println("{:%N}", v7); // 31 } ```
Try it on the Compiler Explorer.
Try It Out
The Compiler Explorer
As can be see in the previous chapter, the mp-units library is available in the Compiler Explorer. Use it to get a fast hands-on experience or try some ideas.
GitHub Codespaces
For more advanced development or contributions we encourage you to use our pre-configured GitHub Codespaces environment. You can either click the button below
or navigate to the main page of the repository and click "Code" button -> "Codespaces" tab -> "Create codespace on master".
You can also use the pre-configured devcontainer and Docker image manually within your IDE.
For detailed environment documentation, see .devcontainer/README.md.
Owner
- Name: Mateusz Pusz
- Login: mpusz
- Kind: user
- Location: Gdańsk, Poland
- Company: @train-it-eu
- Website: pl.linkedin.com/in/mpusz
- Twitter: mateusz_pusz
- Repositories: 9
- Profile: https://github.com/mpusz
Software architect, chief engineer, security champion, and C++ trainer with more than 14 years of experience in designing, writing and maintaining C++ code.
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it using these metadata."
title: mp-units
abstract: >-
A compile-time enabled Modern C++ library that provides compile-time
dimensional analysis and unit/quantity manipulation.
keywords:
- c++
- library
- dimensional-analysis
- system-of-units
- units
- quantities
- physical-quantities
- physical-units
- units-of-measurement
- quantity-manipulation
type: software
license: MIT
# The below lists individual authors that contributed at least 50 commits to the source code repository.
# The rest of project's contributors are collectively referred to as "The mp-units project team".
authors:
- given-names: Mateusz
family-names: Pusz
orcid: https://orcid.org/0000-0003-0680-0765
- given-names: "Johel Ernesto"
family-names: "Guerrero Peña"
- given-names: "Chip"
family-names: "Hogg"
- name: "The mp-units project team"
contact:
- email: mateusz.pusz@gmail.com
given-names: Mateusz
family-names: Pusz
repository-code: "https://github.com/mpusz/mp-units"
url: "https://mpusz.github.io/mp-units"
repository-artifact: "https://conan.io/center/mp-units"
version: 2.4.0
date-released: "2024-11-05"
identifiers:
- description: "The GitHub release URL of tag 2.4.0"
type: url
value: "https://github.com/mpusz/mp-units/releases/tag/v2.4.0"
GitHub Events
Total
- Create event: 5
- Commit comment event: 105
- Release event: 1
- Issues event: 85
- Watch event: 144
- Delete event: 5
- Issue comment event: 335
- Push event: 254
- Pull request review comment event: 340
- Pull request review event: 336
- Pull request event: 46
- Fork event: 19
Last Year
- Create event: 5
- Commit comment event: 105
- Release event: 1
- Issues event: 85
- Watch event: 144
- Delete event: 5
- Issue comment event: 335
- Push event: 254
- Pull request review comment event: 340
- Pull request review event: 336
- Pull request event: 46
- Fork event: 19
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Mateusz Pusz | m****z@g****m | 3,363 |
| Chip Hogg | c****g@a****h | 148 |
| Johel Ernesto Guerrero Peña | j****p@g****m | 127 |
| Jonas Hoppe | 1****e | 44 |
| rbrugo | b****o@g****m | 44 |
| Yves Delley | d****s@g****h | 41 |
| Ramzi Sabra | y****a@h****m | 20 |
| Markus Hofbauer | m****r@t****e | 19 |
| Andy Little | k****s@y****m | 16 |
| Roth Michaels | r****h@r****s | 15 |
| Antony Peacock | a****k@g****m | 14 |
| Mike Ford | m****y@h****m | 13 |
| Oliver Schönrock | o****r@o****t | 13 |
| Ralph J. Steinhagen | r****n@g****e | 10 |
| Frank Dischner | f****r@g****m | 9 |
| Nick Thompson | n****7@p****m | 6 |
| Nebojsa Cvetkovic | n****t@g****m | 5 |
| Björn Schäpers | s****s@k****m | 5 |
| Jan Sende | 4****e | 4 |
| Soham Roy | s****9@g****m | 3 |
| Uilian Ries | u****s@g****m | 3 |
| jvocht | j****p@m****g | 3 |
| Christoph Seitz | c****z@p****e | 2 |
| dkavolis | 1****s | 2 |
| nbresler | n****r@a****m | 2 |
| dbraeckelmann | 1****n | 1 |
| Cazadorro | n****e | 1 |
| Evelyn LePain | e****n@s****m | 1 |
| Tobias Lorenz | t****z@g****t | 1 |
| TheCoconutChef | t****f@g****m | 1 |
| and 9 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 164
- Total pull requests: 91
- Average time to close issues: 10 months
- Average time to close pull requests: about 2 months
- Total issue authors: 50
- Total pull request authors: 20
- Average comments per issue: 5.72
- Average comments per pull request: 2.34
- Merged pull requests: 67
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 63
- Pull requests: 40
- Average time to close issues: 6 days
- Average time to close pull requests: 4 days
- Issue authors: 25
- Pull request authors: 12
- Average comments per issue: 3.14
- Average comments per pull request: 1.63
- Merged pull requests: 29
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- mpusz (62)
- JohelEGP (20)
- chiphogg (9)
- Becheler (4)
- kwikius (4)
- n0F4x (4)
- Cazadorro (3)
- WBurzynski (3)
- AnthonyVH (3)
- VictorEijkhout (3)
- burnpanck (3)
- khansson (2)
- psychon (2)
- CrustyAuklet (2)
- KangarooKoala (2)
Pull Request Authors
- burnpanck (25)
- mpusz (19)
- rothmichaels (16)
- chiphogg (12)
- JohelEGP (6)
- nebkat (6)
- bourumir-wyngs (2)
- alejandro-alvarez-sonarsource (2)
- jharwell (2)
- hasenradball (2)
- NAThompson (2)
- EALePain (2)
- FrancoisCarouge (2)
- czjhoppe (2)
- jvocht (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- conan *
- pre-commit *
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/cache v3 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- hendrikmuhs/ccache-action v1.2 composite
- ASzc/change-string-case-action v2 composite
- actions/cache v3 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/checkout v3 composite
- actions/upload-artifact v2 composite
- dieghernan/cff-validator main composite
- actions/cache v3 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- peaceiris/actions-gh-pages v3 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/setup-python v4 composite
- github/codeql-action/analyze v2 composite
- github/codeql-action/autobuild v2 composite
- github/codeql-action/init v2 composite