Re:Python 3 in Science: the great migration has begun
by ghshephard on Saturday May 09, 2015 @09:40PM
(#9518419)
You can probably scratch the statistics module as something scientists might be interested in; as much as it's simple set of functions is useful for new users who are overwhelmed by numpy, it doesn't add any new capability to python.
With that said - I love it.
Re:Python 3 in Science: the great migration has begun
by lqdc13 on Saturday May 09, 2015 @11:44PM
(#9518712)
Almost none of these things are used in scientific computing though.
Maybe asyncio and yield from.
Re:Python 3 in Science: the great migration has begun
by ubernostrum on Sunday May 10, 2015 @01:36AM
(#9518966)
I suspect enums have uses, as do the improved async code constructs (and there's more of that in the pipeline).
Re:Python 3 in Science: the great migration has begun
by m_mueller on Sunday May 10, 2015 @03:22AM
(#9519176)
Yes, I do use python for scientific applications and enums are one of the things I miss - I've built around it in python 2.x by using this construct:
def enum(*sequential, **named):
enums = dict(zip(sequential, range(len(sequential))), **named)
return type('Enum', (), enums)
Init = enum("NOTHING_LOADED",
"DEPENDANT_ENTRYNODE_ATTRIBUTES_LOADED",
"ROUTINENODE_ATTRIBUTES_LOADED",
"DECLARATION_LOADED"
)
myState = Init.NOTHING_LOADED
3.x is still a non starter for me since many clusters where I want my software to work still only come with 2.6, e.g. I can't even use dictionary comprehensions. Adoption for scientific software is heavily influenced by how many external dependencies you have - requiring users without root access to compile python 3.x for their cluster home is a no-go.
Re:Python 3 in Science: the great migration has begun
by ubernostrum on Sunday May 10, 2015 @03:10PM
(#9520970)
No offense meant, but if you're at a stage where you use a pre-2.7 version because that's what comes with the OS, then it's not really a case of "looked at 3.x and decided it didn't have anything".
OS vendors who will be supporting ancient Python versions until the next decade are a blight on the entire ecosystem.
Which means those people don't know about/don't get to use, among other things:
* Vastly improved unittest module, including mock objects
* Dictionary-based logging config
* The sysconfig module
* The pathlib module
* Built-in enums
* Single-dispatch generic functions
* The statistics module
* The asyncio module
* The "yield from" syntax to delegate to generators
* The lzma module
* The ipaddress module
And that's without getting into 3.5, which adds things like the matrix multiplication operator that science-y packages will care about and probably port for.