Skip to content

Commit

Permalink
Change RadiationEquivalentDoseRate base unit to Sv/s - v6 (#1470)
Browse files Browse the repository at this point in the history
Fixup of #1468
Port to v6 from #1469

- Add unit `SievertPerSecond`, for SI compatibility, with prefixes Nano,
Micro, Milli
- Change `RadiationEquivalentDoseRate` base unit from `SievertPerHour`
to `SievertPerSecond`
- Update conversion functions.
  • Loading branch information
angularsen authored Dec 25, 2024
1 parent 36b783c commit dc10bf7
Show file tree
Hide file tree
Showing 13 changed files with 638 additions and 185 deletions.
27 changes: 22 additions & 5 deletions Common/UnitDefinitions/RadiationEquivalentDoseRate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Name": "RadiationEquivalentDoseRate",
"BaseUnit": "SievertPerHour",
"BaseUnit": "SievertPerSecond",
"XmlDocSummary": "A dose rate is quantity of radiation absorbed or delivered per unit time.",
"XmlDocsRemarks": "https://en.wikipedia.org/wiki/Dose_rate",
"BaseDimensions": {
Expand All @@ -11,8 +11,8 @@
{
"SingularName": "SievertPerHour",
"PluralName": "SievertsPerHour",
"FromUnitToBaseFunc": "{x}",
"FromBaseToUnitFunc": "{x}",
"FromUnitToBaseFunc": "{x}/3600",
"FromBaseToUnitFunc": "{x}*3600",
"Prefixes": [ "Nano", "Micro", "Milli" ],
"Localization": [
{
Expand All @@ -25,11 +25,28 @@
}
]
},
{
"SingularName": "SievertPerSecond",
"PluralName": "SievertsPerSecond",
"FromUnitToBaseFunc": "{x}",
"FromBaseToUnitFunc": "{x}",
"Prefixes": [ "Nano", "Micro", "Milli" ],
"Localization": [
{
"Culture": "en-US",
"Abbreviations": [ "Sv/s" ]
},
{
"Culture": "ru-RU",
"Abbreviations": [ "Зв/с" ]
}
]
},
{
"SingularName": "RoentgenEquivalentManPerHour",
"PluralName": "RoentgensEquivalentManPerHour",
"FromUnitToBaseFunc": "{x} / 100",
"FromBaseToUnitFunc": "{x} * 100",
"FromUnitToBaseFunc": "{x} / 100 / 3600",
"FromBaseToUnitFunc": "{x} * 100 * 3600",
"Prefixes": [ "Milli" ],
"Localization": [
{
Expand Down
6 changes: 5 additions & 1 deletion Common/UnitEnumValues.g.json
Original file line number Diff line number Diff line change
Expand Up @@ -1869,7 +1869,11 @@
"MillisievertPerHour": 3,
"NanosievertPerHour": 2,
"RoentgenEquivalentManPerHour": 5,
"SievertPerHour": 6
"SievertPerHour": 6,
"SievertPerSecond": 16,
"MicrosievertPerSecond": 17,
"MillisievertPerSecond": 14,
"NanosievertPerSecond": 9
},
"ThermalInsulance": {
"HourSquareFeetDegreeFahrenheitPerBtu": 2,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions UnitsNet.Tests/CustomCode/RadiationEquivalentDoseRateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ public class RadiationEquivalentDoseRateTests : RadiationEquivalentDoseRateTests
{
// Override properties in base class here
protected override bool SupportsSIUnitSystem => false;
protected override double SievertsPerHourInOneSievertPerHour => 1;
protected override double MillisievertsPerHourInOneSievertPerHour => 1e+3;
protected override double MicrosievertsPerHourInOneSievertPerHour => 1e+6;
protected override double NanosievertsPerHourInOneSievertPerHour => 1e+9;
protected override double RoentgensEquivalentManPerHourInOneSievertPerHour => 100;
protected override double MilliroentgensEquivalentManPerHourInOneSievertPerHour => 1e+5;
protected override double SievertsPerSecondInOneSievertPerSecond => 1;
protected override double MillisievertsPerSecondInOneSievertPerSecond => 1e+3;
protected override double MicrosievertsPerSecondInOneSievertPerSecond => 1e+6;
protected override double NanosievertsPerSecondInOneSievertPerSecond => 1e+9;
protected override double SievertsPerHourInOneSievertPerSecond => 3600;
protected override double MillisievertsPerHourInOneSievertPerSecond => 3.6e+6;
protected override double MicrosievertsPerHourInOneSievertPerSecond => 3.6e+9;
protected override double NanosievertsPerHourInOneSievertPerSecond => 3.6e+12;
protected override double RoentgensEquivalentManPerHourInOneSievertPerSecond => 3.6e+5;
protected override double MilliroentgensEquivalentManPerHourInOneSievertPerSecond => 3.6e+8;

[Fact]
public void RadiationEquivalentDoseRateTimesTimeSpanEqualsRadiationEquivalentDose()
Expand Down
Loading

0 comments on commit dc10bf7

Please sign in to comment.