Pull request branch #2

Merged
merged 20 commits into from Aug 13, 2016

Conversation

Projects
None yet
3 participants
@mailund
Contributor

mailund commented Aug 13, 2016

I have added unit tests and coverage tests. To make it easier to follow the coverage reports I have split the functionality into different files, but it will still work if all functions are put together again in a single file.

I had some plans for building a similar package to use in a couple of books I am writing, one on OOP and one on domain-specific languages in R, with a little different design for manipulation of units in mind, but I will try to build it on top of this package instead.

For my own use I cannot be restricted to standard physical units, though, so I will do write some code to deal with arbitrary units and default to udunits when units are known there. I have to think this through a little more, though.

This pull request is just the unit tests that I need before I start fiddling with the package code, and I thought you might find them useful as well.

@codecov-io

This comment has been minimized.

Show comment
Hide comment
@codecov-io

codecov-io Aug 13, 2016

Current coverage is 100% (diff: 100%)

No coverage report found for master at ec099e5.

Powered by Codecov. Last update ec099e5...48e8cb2

Current coverage is 100% (diff: 100%)

No coverage report found for master at ec099e5.

Powered by Codecov. Last update ec099e5...48e8cb2

@edzer

This comment has been minimized.

Show comment
Hide comment
@edzer

edzer Aug 13, 2016

Member

Great work! Mind if I add you as contributor?

Member

edzer commented Aug 13, 2016

Great work! Mind if I add you as contributor?

@edzer edzer merged commit f63d672 into r-quantities:master Aug 13, 2016

2 checks passed

codecov/patch 100% of diff hit (target 100%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@mailund

This comment has been minimized.

Show comment
Hide comment
@mailund

mailund Aug 13, 2016

Contributor

Of course :)

I will continue with the design I am considering on my own fork, but if you like it once it is done I would be happy to merge into your version and drop my own fork.

Cheers

Contributor

mailund commented Aug 13, 2016

Of course :)

I will continue with the design I am considering on my own fork, but if you like it once it is done I would be happy to merge into your version and drop my own fork.

Cheers

@edzer

This comment has been minimized.

Show comment
Hide comment
@edzer

edzer Aug 13, 2016

Member

Great, I look forward to see how you'd generalize this beyond physical units / udunits stuff, and am open to sharing authorship.

Member

edzer commented Aug 13, 2016

Great, I look forward to see how you'd generalize this beyond physical units / udunits stuff, and am open to sharing authorship.

@mailund

This comment has been minimized.

Show comment
Hide comment
@mailund

mailund Aug 13, 2016

Contributor

It is not something terribly clever I have in mind, I am just going to do conversions myself by knowing conversion constants. The hard part is reducing the unit arithmetic, but that is something I will figure out.

Contributor

mailund commented Aug 13, 2016

It is not something terribly clever I have in mind, I am just going to do conversions myself by knowing conversion constants. The hard part is reducing the unit arithmetic, but that is something I will figure out.

@edzer

This comment has been minimized.

Show comment
Hide comment
@edzer

edzer Aug 13, 2016

Member

Have you thought about adding your units to the udunits units database?

Member

edzer commented Aug 13, 2016

Have you thought about adding your units to the udunits units database?

@mailund

This comment has been minimized.

Show comment
Hide comment
@mailund

mailund Aug 13, 2016

Contributor

It is unfortunately not that simple. We work with various time units, like mutations per year and years per generations that depends on the organisms we work with, so there are not really fixed conversions.

No worries, though, I know how to do the conversions myself in the framework, I just have to get some symbolic manipulation of units up and running. I will get it done tonight and show what I have in mind.

Contributor

mailund commented Aug 13, 2016

It is unfortunately not that simple. We work with various time units, like mutations per year and years per generations that depends on the organisms we work with, so there are not really fixed conversions.

No worries, though, I know how to do the conversions myself in the framework, I just have to get some symbolic manipulation of units up and running. I will get it done tonight and show what I have in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment