Updated with petroleum industry units
ClosedPublic

Authored by joaonetto on Nov 5 2018, 1:22 PM.

Details

Summary

Added a new volume unity Oil Barrels and a new permeability class that handles Darcy and MiliDarcys.

BUG: 388074
FIXED-IN: 5.53

Diff Detail

Repository
R292 KUnitConversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
joaonetto requested review of this revision.Nov 5 2018, 1:22 PM
joaonetto created this revision.
joaonetto abandoned this revision.Nov 5 2018, 1:22 PM
joaonetto updated this revision to Diff 44904.Nov 5 2018, 1:35 PM
  • Updated source code with permeability class
joaonetto abandoned this revision.Nov 5 2018, 1:36 PM
ngraham added a subscriber: ngraham.Nov 5 2018, 1:36 PM

Oops, you want to be sure you're on the permeability branch when you run arc diff.

joaonetto updated this revision to Diff 44905.Nov 5 2018, 1:38 PM

Updated with permeability source code

joaonetto abandoned this revision.Nov 5 2018, 1:38 PM
joaonetto updated this revision to Diff 44906.Nov 5 2018, 1:41 PM

Couldn't update D16681, creating new revision

ngraham requested changes to this revision.Nov 5 2018, 1:53 PM
ngraham added reviewers: broulik, Frameworks.

Great, thanks! This work well; I just have a few comments, listed below.

To update this diff without accidentally creating a new one, make sure you're on the permeability branch in your kunitconversion repo, then make your change and run arc diff. It shouldn't try to create a new one.

src/unit.h
336

Can you add /** @since 5.53 */ above each new one, following the pattern?

src/volume.cpp
452

I'm not sure this should be marked as a common unit. Because it is, I now get oil barrels listed first when I have KRunner convert something like "2 cups" or "8 liters".

This revision now requires changes to proceed.Nov 5 2018, 1:53 PM
ngraham added inline comments.Nov 5 2018, 2:33 PM
src/permeability.cpp
4

Since you created this file, this should be your own copyright.

src/permeability.h
3 ↗(On Diff #44906)

Since you created this file, this should be your own copyright.

ngraham added inline comments.Nov 5 2018, 3:33 PM
src/unit.h
65

Please add /** @since 5.53 */ here, following the pattern.

joaonetto updated this revision to Diff 44914.Nov 5 2018, 3:52 PM
joaonetto marked an inline comment as done.

Reviewed with comments made on this diff.

The header file for class Permeability should probably be named permeability_p.h to match the other category classes since it's a not exported implementation detail

src/unit.h
335

Given this is a new category, assign Darcy = 33000 so that one can still add new values after Yoctoohm to electrical resistance category without breaking compatibility

joaonetto updated this revision to Diff 44917.Nov 5 2018, 4:15 PM
joaonetto marked 3 inline comments as done.

permeability.h renamed to permeability_p.h and change Darcy to start at 33000

joaonetto updated this revision to Diff 44918.Nov 5 2018, 4:16 PM

Looking good now, +1

ngraham accepted this revision.Nov 6 2018, 12:14 AM

Looks great and works great! Nice first patch. Just one more thing is required before I can land it: add the following to the Summary section of the patch:

BUG: 388074
FIXED-IN: 5.53

Thanks!

This revision is now accepted and ready to land.Nov 6 2018, 12:14 AM
joaonetto edited the summary of this revision. (Show Details)Nov 6 2018, 8:47 AM

Done, can land now

Indeed it can. Great job! May it be the first of many. :-)

This revision was automatically updated to reflect the committed changes.