Skip to content

Dynamically Add and Remove Units, Load Multiple Unit Systems#9

Open
billdenney wants to merge 9 commits intopacificclimate:masterfrom
billdenney:master
Open

Dynamically Add and Remove Units, Load Multiple Unit Systems#9
billdenney wants to merge 9 commits intopacificclimate:masterfrom
billdenney:master

Conversation

@billdenney
Copy link

As discussed in #4, this pull request adds the feature to be able to add new unit conversions. In addition to that, it adds the ability to have multiple unit systems in place so that a new unit conversion can be added to one unit system but not another, for instance.

On top of those feature changes, I've also moved the documentation to a roxygen2-style format within the code. All previous documentation was moved as-is (or just correcting some minor typos).

Most of the programming was done by @SwechhyaBista.

The intent of these changes was to maintain your goal of this being a "thin wrapper" as mentioned in #4; we tried to add minimal code on top of linking the C-level functions from the library to R. If it doesn't match that goal in your opinion, please let us know how we can make it fit with your intent.

SwechhyaB and others added 9 commits January 25, 2017 15:27
The code has been modified to have multiple unit system which can be dynamically added and removed.
Functions have been modified to take in extra argument (system name)
 Following new functions have been added:
1. R_ut_free_system
2. R_ut_system_count
3. R_ut_list_systems
4. R_ut_system_cleanup
Functions have been modified to take and pass  an extra argument (system name)
Following new functions have been added:
1. .onUnload
2. ud.free.system
3. ud.add.system
4. ud.list.systems
Following functions have been added:
1. R_ut_remove_unit: function to remove a specified unit in a system
2. R_ut_set_conversion: function to add a specified unit in a system and set the conversion rule
3. get_unit: function called from 'R_ut_set_conversion' applies the conversion based on the function specified by the user
Following two functions have been added:
1. ud.set.conversion : To add a new unit and set the conversion rule
2. ud.remove.unit : To remove a unit from the system.
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