Skip to content

Commit 5b28c98

Browse files
author
Darren Dale
committed
big improvement to constants, can be presented symbolically, can get listed value with .value
1 parent e0ada95 commit 5b28c98

20 files changed

+1901
-777
lines changed

.eric4project/quantities.e4q

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE UserProject SYSTEM "UserProject-4.0.dtd">
33
<!-- eric4 user project file for project quantities -->
4-
<!-- Saved: 2009-01-17, 23:42:15 -->
4+
<!-- Saved: 2009-01-18, 13:21:54 -->
55
<!-- Copyright (C) 2009 , -->
66
<UserProject version="4.0">
77
</UserProject>

.eric4project/quantities.e4t

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE Tasks SYSTEM "Tasks-4.2.dtd">
33
<!-- eric4 tasks file for project quantities -->
4-
<!-- Saved: 2009-01-17, 23:42:15 -->
4+
<!-- Saved: 2009-01-18, 13:21:54 -->
55
<Tasks version="4.2">
66
<Task priority="1" completed="False" bugfix="False">
77
<Summary>TODO: move to physical constants</Summary>
@@ -60,37 +60,28 @@
6060
<Task priority="1" completed="False" bugfix="False">
6161
<Summary>TODO: what is an appropriate value?</Summary>
6262
<Description></Description>
63-
<Created>2009-01-17, 21:28:53</Created>
63+
<Created>2009-01-18, 12:40:47</Created>
6464
<Resource>
6565
<Filename>quantities/uncertainquantity.py</Filename>
6666
<Linenumber>11</Linenumber>
6767
</Resource>
6868
</Task>
69-
<Task priority="1" completed="False" bugfix="False">
70-
<Summary>TODO: use view:</Summary>
71-
<Description></Description>
72-
<Created>2009-01-17, 21:28:53</Created>
73-
<Resource>
74-
<Filename>quantities/uncertainquantity.py</Filename>
75-
<Linenumber>41</Linenumber>
76-
</Resource>
77-
</Task>
7869
<Task priority="1" completed="False" bugfix="False">
7970
<Summary>TODO: what is an appropriate value?</Summary>
8071
<Description></Description>
81-
<Created>2009-01-17, 23:40:05</Created>
72+
<Created>2009-01-18, 13:13:33</Created>
8273
<Resource>
8374
<Filename>quantities/quantity.py</Filename>
84-
<Linenumber>39</Linenumber>
75+
<Linenumber>26</Linenumber>
8576
</Resource>
8677
</Task>
8778
<Task priority="1" completed="False" bugfix="False">
8879
<Summary>TODO: do we want this kind of magic?</Summary>
8980
<Description></Description>
90-
<Created>2009-01-17, 23:40:05</Created>
81+
<Created>2009-01-18, 13:13:33</Created>
9182
<Resource>
9283
<Filename>quantities/quantity.py</Filename>
93-
<Linenumber>347</Linenumber>
84+
<Linenumber>320</Linenumber>
9485
</Resource>
9586
</Task>
9687
</Tasks>

quantities.egg-info/SOURCES.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,16 @@ quantities.egg-info/SOURCES.txt
1212
quantities.egg-info/dependency_links.txt
1313
quantities.egg-info/top_level.txt
1414
quantities/constants/__init__.py
15+
quantities/constants/alternateunits.py
1516
quantities/constants/codata.py
17+
quantities/constants/comptonwavelengths.py
1618
quantities/constants/constants.py
19+
quantities/constants/magneticratios.py
20+
quantities/constants/massequivalence.py
21+
quantities/constants/massratios.py
22+
quantities/constants/mathematical.py
23+
quantities/constants/relationships.py
24+
quantities/constants/utils.py
1725
quantities/tests/__init__.py
1826
quantities/tests/test_quantities.py
1927
quantities/units/__init__.py
@@ -31,6 +39,7 @@ quantities/units/information.py
3139
quantities/units/length.py
3240
quantities/units/mass.py
3341
quantities/units/power.py
42+
quantities/units/prefixes.py
3443
quantities/units/pressure.py
3544
quantities/units/radiation.py
3645
quantities/units/substance.py
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
"""
4+
from __future__ import absolute_import
5+
6+
#import math as _math
7+
from .utils import _cd
8+
from quantities.unitquantity import UnitConstant
9+
10+
11+
Bohr_magneton_in_eV_per_T = UnitConstant(
12+
'Bohr_magneton_in_eV_per_T',
13+
_cd('Bohr magneton in eV/T')
14+
)
15+
Bohr_magneton_in_Hz_per_T = UnitConstant(
16+
'Bohr_magneton_in_Hz_per_T',
17+
_cd('Bohr magneton in Hz/T')
18+
)
19+
Bohr_magneton_in_inverse_meters_per_tesla = UnitConstant(
20+
'Bohr_magneton_in_inverse_meters_per_tesla',
21+
_cd('Bohr magneton in inverse meters per tesla')
22+
)
23+
Bohr_magneton_in_K_per_T = UnitConstant(
24+
'Bohr_magneton_in_K_per_T',
25+
_cd('Bohr magneton in K/T')
26+
)
27+
Boltzmann_constant_in_eV_per_K = UnitConstant(
28+
'Boltzmann_constant_in_eV_per_K',
29+
_cd('Boltzmann constant in eV/K')
30+
)
31+
Boltzmann_constant_in_Hz_per_K = UnitConstant(
32+
'Boltzmann_constant_in_Hz_per_K',
33+
_cd('Boltzmann constant in Hz/K')
34+
)
35+
Boltzmann_constant_in_inverse_meters_per_kelvin = UnitConstant(
36+
'Boltzmann_constant_in_inverse_meters_per_kelvin',
37+
_cd('Boltzmann constant in inverse meters per kelvin')
38+
)
39+
Hartree_energy_in_eV = UnitConstant(
40+
'Hartree_energy_in_eV',
41+
_cd('Hartree energy in eV')
42+
)
43+
natural_unit_of_action_in_eV_s = UnitConstant(
44+
'natural_unit_of_action_in_eV_s',
45+
_cd('natural unit of action in eV s')
46+
)
47+
natural_unit_of_energy_in_MeV = UnitConstant(
48+
'natural_unit_of_energy_in_MeV',
49+
_cd('natural unit of energy in MeV')
50+
)
51+
natural_unit_of_momentum_in_MeV_per_c = UnitConstant(
52+
'natural_unit_of_momentum_in_MeV_per_c',
53+
_cd('natural unit of momentum in MeV/c')
54+
)
55+
nuclear_magneton_in_eV_per_T = UnitConstant(
56+
'nuclear_magneton_in_eV_per_T',
57+
_cd('nuclear magneton in eV/T')
58+
)
59+
nuclear_magneton_in_inverse_meters_per_tesla = UnitConstant(
60+
'nuclear_magneton_in_inverse_meters_per_tesla',
61+
_cd('nuclear magneton in inverse meters per tesla')
62+
)
63+
nuclear_magneton_in_K_per_T = UnitConstant(
64+
'nuclear_magneton_in_K_per_T',
65+
_cd('nuclear magneton in K/T')
66+
)
67+
nuclear_magneton_in_MHz_per_T = UnitConstant(
68+
'nuclear_magneton_in_MHz_per_T',
69+
_cd('nuclear magneton in MHz/T')
70+
)
71+
Planck_constant_in_eV_s = UnitConstant(
72+
'Planck_constant_in_eV_s',
73+
_cd('Planck constant in eV s')
74+
)
75+
Rydberg_constant_times_c_in_Hz = UnitConstant(
76+
'Rydberg_constant_times_c_in_Hz',
77+
_cd('Rydberg constant times c in Hz')
78+
)
79+
Rydberg_constant_times_hc_in_eV = UnitConstant(
80+
'Rydberg_constant_times_hc_in_eV',
81+
_cd('Rydberg constant times hc in eV')
82+
)
83+
Rydberg_constant_times_hc_in_J = UnitConstant(
84+
'Rydberg_constant_times_hc_in_J',
85+
_cd('Rydberg constant times hc in J'),
86+
symbol='(R_infinity*h*c)',
87+
u_symbol='(R_∞·h·c)'
88+
)
89+
90+
del UnitConstant, _cd
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
"""
4+
from __future__ import absolute_import
5+
6+
#import math as _math
7+
from .utils import _cd
8+
from quantities.unitquantity import UnitConstant
9+
10+
11+
lambda_C_mu = muon_Compton_wavelength = UnitConstant(
12+
'muon_Compton_wavelength',
13+
_cd('muon Compton wavelength'),
14+
symbol='lambdabar_C_mu',
15+
u_symbol='λ_C_μ'
16+
)
17+
muon_Compton_wavelength_over_2_pi = UnitConstant(
18+
'muon_Compton_wavelength_over_2_pi',
19+
_cd('muon Compton wavelength over 2 pi'),
20+
symbol='lambdabar_Cmu',
21+
u_symbol='ƛ_C_μ'
22+
)
23+
lambda_C_n = neutron_Compton_wavelength = UnitConstant(
24+
'neutron_Compton_wavelength',
25+
_cd('neutron Compton wavelength'),
26+
symbol='lambda_C_n',
27+
u_symbol='λ_C_n'
28+
)
29+
neutron_Compton_wavelength_over_2_pi = UnitConstant(
30+
'neutron_Compton_wavelength_over_2_pi',
31+
_cd('neutron Compton wavelength over 2 pi'),
32+
symbol='lambdabar_C_n',
33+
u_symbol='ƛ_C_n'
34+
)
35+
lambda_C_p = proton_Compton_wavelength = UnitConstant(
36+
'proton_Compton_wavelength',
37+
_cd('proton Compton wavelength'),
38+
symbol='lambda_C_p',
39+
u_symbol='λ_C_p'
40+
)
41+
proton_Compton_wavelength_over_2_pi = UnitConstant(
42+
'proton_Compton_wavelength_over_2_pi',
43+
_cd('proton Compton wavelength over 2 pi'),
44+
symbol='lambdabar_C_p',
45+
u_symbol='ƛ_C_p'
46+
)
47+
lambda_C_tau = tau_Compton_wavelength = UnitConstant(
48+
'tau_Compton_wavelength',
49+
_cd('tau Compton wavelength'),
50+
symbol='lambda_C_tau',
51+
u_symbol='λ_C_τ'
52+
)
53+
tau_Compton_wavelength_over_2_pi = UnitConstant(
54+
'tau_Compton_wavelength_over_2_pi',
55+
_cd('tau Compton wavelength over 2 pi'),
56+
symbol='lambda_C_tau',
57+
u_symbol='ƛ_C_τ'
58+
)
59+
60+
del UnitConstant, _cd

0 commit comments

Comments
 (0)