ANN: magnitude 0.9.2

J

Joan M. Garcia

Following the feedback on the first release of magnitude it
has changed enough to deserve a second release, which
modifies the API, solves a couple of bugs, and brings it in
line with python's style guide. Main changes:

* imul, idiv had wrong output unit, so that after a /= b
printing showed wrong units.

* mod's output has the units of the division.

* outputPrecission, defaultFormat and outputUnits are now
output_precision, default_format and output_units.


Magnitude:

A physical quantity is a number with a unit, like 10
km/h. Units can be any of the SI units, plus a bunch of
non-SI, bits, dollars, and any combination of them. They can
include the standard SI prefixes. Magnitude can operate with
physical quantities, parse their units, and print them. You
don't have to worry about unit consistency or conversions;
everything is handled transparently. By default output is
done in basic SI units, but you can specify any output unit,
as long as it can be reduced to the basic units of the
phisical quantity.

Home page: http://juanreyero.com/magnitude/

Cheers,

jm
 
T

Thomas Heller

Joan said:
Following the feedback on the first release of magnitude it
has changed enough to deserve a second release, which
modifies the API, solves a couple of bugs, and brings it in
line with python's style guide. Main changes:

* imul, idiv had wrong output unit, so that after a /= b
printing showed wrong units.

* mod's output has the units of the division.

* outputPrecission, defaultFormat and outputUnits are now
output_precision, default_format and output_units.


Magnitude:

A physical quantity is a number with a unit, like 10
km/h. Units can be any of the SI units, plus a bunch of
non-SI, bits, dollars, and any combination of them. They can
include the standard SI prefixes. Magnitude can operate with
physical quantities, parse their units, and print them. You
don't have to worry about unit consistency or conversions;
everything is handled transparently. By default output is
done in basic SI units, but you can specify any output unit,
as long as it can be reduced to the basic units of the
phisical quantity.

Home page: http://juanreyero.com/magnitude/

Three comments, from looking at it:

- "physical", not "phisical" ;-)

- you raise string exceptions in various places; these are deprecated and
should not be used. Also it is very difficult to catch them.

- ScientificPython from Konrad Hinsen also contains a somewhat similar
module. IIRC, it is named PhysicalQuantities. You might look into that
and mention it on the homepage.

Thomas
 
J

juan

Thomas Heller said:
- "physical", not "phisical" ;-)

I see a worrisome pattern starting to emerge :). Thanks.
- you raise string exceptions in various places; these are
deprecated and should not be used. Also it is very
difficult to catch them.

Yes, I believe it is the last big thing before I am fully
PEP8-compliant. I'll change it and make a new release as
soon as I can.
- ScientificPython from Konrad Hinsen also contains a
somewhat similar module. IIRC, it is named
PhysicalQuantities.

It is very similar to magnitude. Same approach, almost the
same API.
You might look into that and mention it on the homepage.

Done. I will eventually have to stop adding references to
alternatives, but so far so good.

jm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top