Helping update GSoC ideas page

101 views
Skip to first unread message

Aaron Meurer

unread,
Feb 3, 2022, 4:42:38 PM2/3/22
to sympy
The Google Summer of Code organization applications open next week. I
would appreciate help updating the GSoC ideas page
https://github.com/sympy/sympy/wiki/GSoC-Ideas. Please remove any
ideas that are already implemented and add any new ones.

Another thing is that this year they are changing the program a little
bit. Projects can now be medium size (175 hours) or large (350 hours).
This means that we will need to indicate on the ideas page which ideas
are for smaller projects and which are for larger projects. Any help
in doing this would be appreciated.

Other changes are that the project end date can now be extended past
August, and the program is now open to everyone 18 and older, not just
students. See https://opensource.googleblog.com/2021/11/expanding-google-summer-of-code-in-2022.html.

Aaron Meurer

Aaron Meurer

unread,
Feb 3, 2022, 4:44:49 PM2/3/22
to sympy
I should also mention if you are able to help mentor this year, please
add your name to the list at
https://github.com/sympy/sympy/wiki/GSoC-Ideas#potential-mentors.

Aaron Meurer

David Bailey

unread,
Feb 4, 2022, 12:30:02 PM2/4/22
to sy...@googlegroups.com
Dear Group,

On the face of it, attaching appropriate physical units to variables
sounds an excellent idea, but if, say, you import speed_of_light from
sympy.physics.units, you have to extract an expression containing the
speed and the physical units:

sl=speed_of_light.convert_to(meter/second)

This is OK, but in more complicated cases - e.g. the
gravitational_constant - it would be nice to be able to extract the
value with appropriate units without actually knowing the units in
advance - just as if you looked it up in a handbook you would find
something equivalent to

6.6743e-11*meter^2*newton/kilogram^2

Also, if you just write an expression with speed_of_light, the result is
confusing, because naively I thought speed_of_light would consist of an
expression - 299792458*meter/second - but you can't use an expression of
that sort at all (as far as I could see).

Indeed it isn't clear why the class
sympy.physics.units.quantities.Quantity exists.

Am I correct that each of these named quantities have to be imported and
subject to convert_to before they are any use in actual calculations?
That didn't seem obvious from the documentation.

I would have thought that introducing the units notation would mean that
meaningless expressions would be faulted - checking the consistency of
is a really useful operation.

sl+3*meter

3*meter + 299792458*meter/second

exp(-sl)

exp(-299792458*meter/second)

Neither of these fault, but I am wondering if there is a function to
check potentially quite complicated expressions for consistency
regarding units?

Looking forward to reading your replies,

David



gu...@uwosh.edu

unread,
Feb 4, 2022, 1:57:01 PM2/4/22
to sympy
David,

I too have found that the units package has been problematic for me to use. My solution is the following.

Units behave as positive numbers (real numbers) the way we use them in the physical sciences. Thus I just define symbols for any units I want to use as positive variables, for example: `var('J m kg s', positive = True)`. Then I worry about conversions later. The only caveat is that you must make sure not to use any of these variables for anything other than units. If I want to define the speed of light I would do `c = 29979258*m/s` assuming I do not want to use `c` for anything else. I have thought about pulling them out of the physics.units package or scrapping them from NIST automatically, but It hasn't been worth it to me.

Here's a really simple example using my algebra_with_sympy package for ideal gas law and heat capacity calculations. I could have defined some of the constants, but just chose to copy and paste the numbers for the constants in for each calculation. The second line of the numerical calculation of `n` also illustrates using substitution to do unit conversions. If you just used sympy all you would lose is the nice display of the algebraic equations.
calc with units.png
Jonathan

gu...@uwosh.edu

unread,
Feb 4, 2022, 2:55:37 PM2/4/22
to sympy
I did not really say this, but this gets you all the automatic checking too. For example sympy will not add something with units of meters to something with units of seconds. I suspect this could be coupled to the units package by making sure that units behave as symbols.

Jonathan

Chris Smith

unread,
Feb 4, 2022, 7:09:08 PM2/4/22
to sympy
If you are using the unit system you probably have an idea of what unit a given quantity should be represented, so there is no need to create dummy place holders for units. That is what the units in SymPy are for:

>>> var('n P V T')
(n, P, V, T)
>>> from sympy.physics.units import *
>>> gas = Eq(n, P*V/R/T)
>>> rhs = gas.subs({P:3*atm, V:100*inch**3, T:200*K}).rhs

generic quantities:

>>> UnitSystem.get_unit_system("SI").get_dimensional_expr(rhs)
3 amount_of_substance*length *pressure ------------------------------------ energy

specific units and constants

>>> rhs
3 3*atmosphere*inch --------------------------- 2*kelvin*molar_gas_constant


a specific unit

>>> convert_to(rhs, mol)
0.299553802101669*mole

It might be instructive to try these 3 operations on R itself.

/c

Aaron Meurer

unread,
Feb 16, 2022, 6:31:21 PM2/16/22
to sympy
Reminder to please help update the GSoC ideas page. https://github.com/sympy/sympy/wiki/GSoC-Ideas. I have just submitted our org application (the deadline is Monday) and the ideas list is a big part of that.

All ideas should indicate whether they are appropriate for a medium term (175 hours) or long term (350 hours) project, and if it's a long term, whether it can be broken up into a smaller medium term project.

Also, as before, please add your name to the potential mentors list if you can mentor this year. https://github.com/sympy/sympy/wiki/GSoC-Ideas#potential-mentors

Aaron Meurer

Aaron Meurer

unread,
Feb 25, 2022, 4:17:25 PM2/25/22
to sympy
Google is going to be reviewing our ideas page to decide if we will be
selected or not this weekend, so if you were planning on updating the
ideas page, please do so now.

Google has emailed us to ask us to make sure that every idea includes
a project length (either 175 hours or 350 hours). I have added project
lengths to the existing ideas, but please check that these are
correct. If you add a new idea, please make sure to include this.

They also requested that each idea has the following information

a) a project title/description
b) more detailed description of the project (2-5+ sentences)
c) expected outcomes
d) skills required/preferred
e) possible mentors
f) expected size of project (175 or 350 hour)
g) an easy, medium or hard difficulty rating of each project.

So make sure to use the template on
https://github.com/sympy/sympy/wiki/GSoC-Ideas when adding an idea.

Aaron Meurer
Reply all
Reply to author
Forward
0 new messages