Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quantity power rate #419

Merged
merged 1 commit into from
Jun 24, 2023
Merged

Conversation

groscoe2
Copy link
Contributor

I believe I've changed everything necessary to add power rate (base units are watts per second). Please let me know if I missed anything required to merge!

@iliekturtles
Copy link
Owner

Thanks for the PR. If you could add these formatting fixes I'll merge!

diff --git a/src/si/power_rate.rs b/src/si/power_rate.rs
index e65dcba..9134208 100644
--- a/src/si/power_rate.rs
+++ b/src/si/power_rate.rs
@@ -17,40 +17,29 @@ quantity! {
             "yottawatts per second";
         @zettawatt_per_second: prefix!(zetta); "ZW/s", "zettawatt per second",
             "zettawatts per second";
-        @exawatt_per_second: prefix!(exa); "EW/s", "exawatt per second",
-            "exawatts per second";
-        @petawatt_per_second: prefix!(peta); "PW/s", "petawatt per second",
-            "petawatts per second";
-        @terawatt_per_second: prefix!(tera); "TW/s", "terawatt per second",
-            "terawatts per second";
-        @gigawatt_per_second: prefix!(giga); "GW/s", "gigawatt per second",
-            "gigawatts per second";
-        @megawatt_per_second: prefix!(mega); "MW/s", "megawatt per second",
-            "megawatts per second";
-        @kilowatt_per_second: prefix!(kilo); "kW/s", "kilowatt per second",
-            "kilowatts per second";
+        @exawatt_per_second: prefix!(exa); "EW/s", "exawatt per second", "exawatts per second";
+        @petawatt_per_second: prefix!(peta); "PW/s", "petawatt per second", "petawatts per second";
+        @terawatt_per_second: prefix!(tera); "TW/s", "terawatt per second", "terawatts per second";
+        @gigawatt_per_second: prefix!(giga); "GW/s", "gigawatt per second", "gigawatts per second";
+        @megawatt_per_second: prefix!(mega); "MW/s", "megawatt per second", "megawatts per second";
+        @kilowatt_per_second: prefix!(kilo); "kW/s", "kilowatt per second", "kilowatts per second";
         @hectowatt_per_second: prefix!(hecto); "hW/s", "hectowatt per second",
             "hectowatts per second";
-        @decawatt_per_second: prefix!(deca); "daW/s", "decawatt per second",
-            "decawatts per second";
+        @decawatt_per_second: prefix!(deca); "daW/s", "decawatt per second", "decawatts per second";
         /// Derived unit of power rate.
         @watt_per_second: prefix!(none); "W/s", "watt per second", "watts per second";
-        @deciwatt_per_second: prefix!(deci); "dW/s", "deciwatt per second",
-            "deciwatts per second";
+        @deciwatt_per_second: prefix!(deci); "dW/s", "deciwatt per second", "deciwatts per second";
         @centiwatt_per_second: prefix!(centi); "cW/s", "centiwatt per second",
             "centiwatts per second";
         @milliwatt_per_second: prefix!(milli); "mW/s", "milliwatt per second",
             "milliwatts per second";
         @microwatt_per_second: prefix!(micro); "µW/s", "microwatt per second",
             "microwatts per second";
-        @nanowatt_per_second: prefix!(nano); "nW/s", "nanowatt per second",
-            "nanowatts per second";
-        @picowatt_per_second: prefix!(pico); "pW/s", "picowatt per second",
-            "picowatts per second";
+        @nanowatt_per_second: prefix!(nano); "nW/s", "nanowatt per second", "nanowatts per second";
+        @picowatt_per_second: prefix!(pico); "pW/s", "picowatt per second", "picowatts per second";
         @femtowatt_per_second: prefix!(femto); "fW/s", "femtowatt per second",
             "femtowatts per second";
-        @attowatt_per_second: prefix!(atto); "aW/s", "attowatt per second",
-            "attowatts per second";
+        @attowatt_per_second: prefix!(atto); "aW/s", "attowatt per second", "attowatts per second";
         @zeptowatt_per_second: prefix!(zepto); "zW/s", "zeptowatt per second",
             "zeptowatts per second";
         @yoctowatt_per_second: prefix!(yocto); "yW/s", "yoctowatt per second",
@@ -68,8 +57,8 @@ quantity! {
             "horsepower per second (electric)";
         @horsepower_per_second_metric: 7.354_988_E2; "hp/s (M)", "metric horsepower per second",
             "metric horsepower per second";
-        @horsepower_per_second_imperial: 7.457_0_E2; "hp/s (I)",
-            "horsepower per second (Imperial)", "horsepower per second (Imperial)";
+        @horsepower_per_second_imperial: 7.457_0_E2; "hp/s (I)", "horsepower per second (Imperial)",
+            "horsepower per second (Imperial)";
         @hydraulic_horsepower_per_second: 7.460_43_E2; "hp/s (hydraulic)",
             "hydraulic horsepower per second", "hydraulic horsepower per second";
     }

@groscoe2
Copy link
Contributor Author

Should be good to go now, thank you!

@iliekturtles
Copy link
Owner

Mind squashing the two commits?

@groscoe2
Copy link
Contributor Author

Took a bit to figure out how to do that, but it should be squashed now!

@iliekturtles iliekturtles merged commit 7669623 into iliekturtles:master Jun 24, 2023
@iliekturtles
Copy link
Owner

Thanks for the quick fixes. Merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants