Maybe the assumptions system isn't a direct fit for this, but the
kinds of questions we are addressing with it also apply here. So once
we decide how we are going to handle that, we should look back and
apply it to the units system.

If you're interested, look at the other threads on this list about the
assumptions system, especially the ones going on right now.

Aaron Meurer

On Wed, Apr 10, 2013 at 12:50 PM, F. B. <[email protected]> wrote:
> Well, I had a look at that pull request. A lot of work has already been
> done!
>
> in file sympy/physics/unitsystem/units.py, in the class UnitSystem( ... ),
> insert the following methods:
>
>     def __enter__(self):
>         global _UNIT_SYSTEM
>         try:
>             self.__tmp_old_unitsystem = _UNIT_SYSTEM
>         except NameError:
>             self.__tmp_old_unitsystem = None
>         _UNIT_SYSTEM = self
>
>     def __exit__(self, type, value, traceback):
>         global _UNIT_SYSTEM
>         _UNIT_SYSTEM = self.__tmp_old_unitsystem
>
> In the file /sympy/physics/unitsystems/tests/test_units.py substitute
> blocks:
>
>     set_system(mks)
>      ...
>     set_system(None)
>
> with
>
>     with mks:
>         ...
>
> or maybe keep both (set_system and with_statement) types of tests?
>
>
> On Wednesday, April 10, 2013 4:50:26 AM UTC+2, Aaron Meurer wrote:
>>
>> I like the idea of the context manager. How does this fit with the
>> ideas from https://github.com/sympy/sympy/pull/1389?
>>
>> We should also see if this can all be done with the new assumptions
>> system (or if it makes sense to).
>>
>> Aaron Meurer
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy?hl=en-US.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to