Comments (7)
Here are some antimatter matters with inconsistent or undesirable behavior:
>>> charge_state('p-')
-1
>>> charge_state('e+')
ValueError: Invalid element or isotope information in charge_state
>>> charge_state('positron')
ValueError: Invalid element or isotope information in charge_state
>>> charge_state('antiproton')
ValueError: Invalid element or isotope information in charge_state
from plasmapy.
We may want charge_state
to allow electrons, even though it was intended for ions.
>>> charge_state('electron')
ValueError: Invalid element or isotope information in charge_state
>>> charge_state('e-')
ValueError: Invalid element or isotope information in charge_state
from plasmapy.
Some more thoughts while I'm talking to myself: 😸 💬
- It would probably helpful to have a function called
charge
that would give the physical value of the charge for various particles. This would be easy to add. - I'm wondering if it would be worth considering particles like muons, pions, etc. These do not come up that often for most plasma physicists, but may come up if people are studying cosmic rays and things like that and would also be straightforward to add.
- There are still lots of half-lives for different isotopes that are missing.
from plasmapy.
It would be pretty handy to have charge_state
and even ion_mass
to allow electrons and perhaps more exotic particles - as it stands with Species
in #54 , I would like to permit initializing those with a string and avoid having special cases for electrons. This seems like a better place for that.
A charge
function seems trivial to pull off, as most of the exceptions are already in charge_state
(did anybody say, low hanging fruit? 😃 )
Oh yeah, one more thing: I think we could do some automated testing here using pytest
fixtures, given that all the data is already really neatly placed into python data structures.
from plasmapy.
One more bug:
>>> plasmapy.constants.ion_mass('He-3 2+')
<Quantity 6.64465723e-27 kg>
>>> plasmapy.constants.ion_mass('He-4 2+')
<Quantity 6.64465723e-27 kg>
'He-3 2+'
is giving the wrong mass, since it's interpreting it as an alpha particle.
from plasmapy.
Of the bugs I mentioned, I believe all have been fixed except for this one:
>>> charge_state('H-1-')
from plasmapy.
This was resolved in: #122
The original title of this issue (to allow ions to be represented as a tuple) did not get implemented since something like ('H', 1)
would leave it ambiguous about whether the 1
meant the charge state or the isotope. The Species
class is an improvement over this idea.
from plasmapy.
Related Issues (20)
- Improve Thomson module
- Different return types for `is_category` method of `ParticleList` than `Particle` & `CustomParticle` HOT 3
- Make it so that mypy thinks that `ParticleLike` has the same attributes as `Particle`
- Store downloaded data in `$XDG_DATA_HOME` if that environment variable exists HOT 1
- Multiple density values in `formulary.radiation.thermal_bremsstrahlung` returns `ValueError`
- `thomson_fitting` error with `lmfit==1.3.0` HOT 3
- Make it so that `plasmapy.__version__` uses current date in editable installs
- Verify that files are included or not included in source distributions and wheels
- Show correct version in title of `latest` docs
- Enable weekly tests with the JIT compiler to be added in Python 3.13
- CI codecov bug HOT 2
- Allow ParticleTracker to accept analytical fields (as functions) or lists of currents/charges
- Add helper functionality to plot quantities against temperature with axes labeled in both K and eV HOT 2
- Add `latex_str` attribute to `Particle`
- Add Jupyter notebook that plots reconnection phase diagram
- what is the unit of temperature defined in the Spitzer resistivity HOT 1
- Requirements files need to be rethought HOT 2
- Spin off plasma calculator into separate affiliated package
- Rename `binding_energy` property of `Particle` to `nuclear_binding_energy` and add `electron_binding_energy` based on `ionization_energy`
- Add a Nox session to build the changelog
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plasmapy.