Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Support dimensionless units of measurement #57

Merged
merged 3 commits into from
Mar 7, 2024
Merged

Conversation

JR-1991
Copy link
Collaborator

@JR-1991 JR-1991 commented Mar 7, 2024

As higlighted in #56 the current implementation does not allow to add dimensionless units. This PR fixes it by providing a way to add this type of unit. The resulting Unit object will only contain the name dimensionless with an empty list of bases. In addition, the corresponding Unit(dimensionless_unscaled) will be added to the _unit attribute.

Example

unit = Unit.from_string("dimensionless")
print(unit.json())

Output

{
  "my_unit": {
    "id": "6a632e6b-a6bf-4a63-952f-ce037206c6b8",
    "name": "dimensionless",
    "bases": []
  }
}

Closes #56

@JR-1991 JR-1991 added bug Something isn't working enhancement New feature or request labels Mar 7, 2024
@JR-1991 JR-1991 added this to the 0.3.0 milestone Mar 7, 2024
@JR-1991 JR-1991 self-assigned this Mar 7, 2024
@JR-1991 JR-1991 linked an issue Mar 7, 2024 that may be closed by this pull request
@JR-1991 JR-1991 merged commit a50a66c into main Mar 7, 2024
3 checks passed
@JR-1991 JR-1991 deleted the 56-dimensionslose-werte branch May 12, 2024 00:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dimensionslose Werte
1 participant