Skip to content

Commit

Permalink
Merge pull request #54 from Tehforsch/v0.4.0
Browse files Browse the repository at this point in the history
V0.4.0
  • Loading branch information
Tehforsch authored Jan 7, 2024
2 parents ba437be + 9e565ff commit 6428530
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# v0.4.0
## Features
- Overhauled the `unit_system` macro. (see the readme and the SI module in `src/si.rs` for example usage). (See #44)
- - The `Dimension` type does not need to be defined by the user anymore and is derived automatically.
- - The new syntax is much more explicit about what the base units are and prevents accidentally declaring multiple base units (which could be a critical error).
- - Similarly, defining units in terms of a dimension is not allowed anymore and units can only be derived from the base units and other derived units.
- - Support adding prefixes to custom units via the `#[prefix(...)]` attribute to save time and prevent bugs due to typos due to wrong conversion factors.
- - Support adding aliases to custom units via the `#[alias(...)]` attribute.
- - Added a large list of dimensions and units to the SI module, each including all metric prefixes from atto to exa.
- Add support for rational dimensions. This is not enabled by default and requires the `rational-dimensions` feature gate. (See #48)
- Add various numeric trait implementations for references of quantities. (See #50 and #53)

# v0.3.0
## Features
- Add various trait implementations for dimensionless quantities and their underlying storage types: `MulAssign`, `DivAssign` , `PartialEq`, `PartialOrd`, `From`. For example, this makes it possible to write:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "diman"
version = "0.3.0"
version = "0.4.0"
edition = "2021"
description = "Zero-cost compile-time dimensional analysis."
authors = ["Toni Peter <[email protected]>"]
Expand Down Expand Up @@ -41,7 +41,7 @@ hdf5 = { version = "0.8.1", optional = true }
mpi = { version = "0.7", default-features = false, features = ["derive"], optional = true }
once_cell = { version = "1.18.0", optional = true }

diman_unit_system = { path = "crates/diman_unit_system", version = "0.3" }
diman_unit_system = { path = "crates/diman_unit_system", version = "0.4" }

[dev-dependencies]
serde_yaml = "0.9.27"
Expand Down
2 changes: 1 addition & 1 deletion crates/diman_unit_system/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "diman_unit_system"
version = "0.3.0"
version = "0.4.0"
edition = "2021"
authors = [
"Toni Peter <[email protected]>",
Expand Down

0 comments on commit 6428530

Please sign in to comment.