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

Fix physics-unit script #17

Closed
Klortho opened this issue Apr 22, 2012 · 4 comments
Closed

Fix physics-unit script #17

Klortho opened this issue Apr 22, 2012 · 4 comments
Labels

Comments

@Klortho
Copy link
Owner

Klortho commented Apr 22, 2012

Playing with this some this evening, I'm noticing that the physics-unit script seems to be a work in progress. I like the way it's designed, first of all, by invoking Script.pm, and putting all the meat in there.

Here are a couple of problems I've noticed:

  • "physics-unit cubic": dies.
  • "physics-unit farad": returns "conversion: 0.001 farad". This is because you're assuming that the base unit for one of the types (in this case capacitance) has a multiplicative factor of 1. That's not the case.
  • "physics-unit Capacitance": doesn't work quite right.

I'd like to rework it a little so that it returns a different report for each type of name.

It should also be really easy to enhance it to do conversions:
physics-unit "furlongs per fortnight" "metre per second"
> 1.663×10−4

@jberger
Copy link
Collaborator

jberger commented Apr 22, 2012

Duplicate of #15, at least partially. I really did hack this together quite quickly as a proof of concept. Please, make any changes you want, it seems that you get my general concept for the script, but I don't know enough of the internals to make it work correctly in all cases.

@jberger
Copy link
Collaborator

jberger commented Apr 22, 2012

One other thing: The best part about having the logic in a module is that we can write some tests for the script's major functions without system calls. I just need to get around to writing them :/

Klortho added a commit that referenced this issue Apr 22, 2012
@Klortho
Copy link
Owner Author

Klortho commented Apr 29, 2012

I fixed the specific problems in this ticket's description.

@jberger
Copy link
Collaborator

jberger commented Apr 29, 2012

Well done sir!

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

No branches or pull requests

2 participants