#3852: create or adapt or include a units package
--------------------------------+-------------------------------------------
Reporter: jason | Owner: somebody
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.4
Component: basic arithmetic | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------------+-------------------------------------------
Changes (by ddrake):
* status: needs_review => needs_work
Comment:
Some questions and comments:
In {{{unit_derivations_expr}}} (in units.py), why the check to see that Z
is a string? We get Z by looking up something in a dictionary whose values
are all strings, so either Z is a string, or we threw a ValueError and
aren't executing the rest of the function anyway. It looks like the "if
isinstance" bit can be deleted. Am I misunderstanding something?
A minor point: the string representation of collections of units uses
strange/incorrect grammar. "Collection area of units" sounds like units do
collecting in a certain area. I think "Collection of units of area" is
better. How about something like
{{{
name = ' of ' + self.__name if self.__name else ''
return "Collection of units%s: %s"%(name, ' '.join(sorted([str(x) for x in
self.__data])))
}}}
in the {{{__repr___}}} method for Units?
In the descriptions of the mass units, the solar mass refers to the size
of the earth -- but you mean the mass of the earth. Size is length, area,
or volume; different units!
Perhaps we should include "metre" and "litre" as synonyms; it seems that
the official spelling, according to the SI Brochure, is "metre", and
that's a common spelling anyway. The liter/litre isn't an official SI
unit, but it is frequently spelled as litre, so might as well put in both.
This would also allow non-Americans putting units into their LaTeX
documents to get correctly-spelled units.
This module should get added to the reference manual (perhaps we can do
that in another ticket), and a bunch of little bits in the docstrings need
to be fixed up. One suggestion: change the title at the very top of
units.py to "Units of measurement" to avoid confusion with
multiplicatively invertible elements of a ring.
Line 600 or so: I would find it much less confusing if ton_force was
described with "Defined to be 2000 pounds of force".
In line 685: the documentation for candela has some goofy stuff near the
end. According to the official brochure, you need "1/683 watt per
steradian".
Overall, I think this is a great addition to Sage. The code is pretty
simple, works well, and is thoroughly doctested. Once the above issues are
addressed, this can get a positive review. I can whip up a patch making
the above changes, or can review someone else's patch.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/3852#comment:16>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.