aton 0.0.1a3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
aton/__init__.py ADDED
@@ -0,0 +1,15 @@
1
+ '''
2
+ .. include:: ../_README_temp.md
3
+ '''
4
+
5
+
6
+ from ._version import __version__ as version
7
+ from . import alias
8
+ from . import units
9
+ from . import elements
10
+ from .atoms import atoms
11
+ from . import call
12
+ from . import file
13
+ from . import text
14
+ from . import interface
15
+
aton/_version.py ADDED
@@ -0,0 +1,14 @@
1
+ """
2
+ # Description
3
+
4
+ Package version is defined here. Follows semantic versioning, as in:
5
+
6
+ `vMAJOR.MINOR.PATCH.`
7
+
8
+ More about semantic versioning:
9
+ https://semver.org/
10
+
11
+ """
12
+
13
+ __version__ = 'v0.0.1a3'
14
+
aton/alias.py ADDED
@@ -0,0 +1,89 @@
1
+ '''
2
+ # Description
3
+ This module contains common dictionaries to normalise and correct user inputs.
4
+ All values are in lowercase to allow comparison with the `string.lower()` method.
5
+
6
+ Use example:
7
+ ```python
8
+ unit = 'Electronvolts'
9
+ if unit.lower() in aton.alias.units['eV']:
10
+ ... do stuff ...
11
+ ```
12
+
13
+ # Index
14
+ - `units`
15
+ - `parameters`
16
+ - `experiments`
17
+ - `files`
18
+ - `boolean`
19
+
20
+ ---
21
+ '''
22
+
23
+
24
+ units: dict = {
25
+ 'mol' : ['mol', 'mols', 'mole', 'moles'],
26
+ 'g' : ['g', 'gram', 'grams'],
27
+ 'kg' : ['kg', 'kilogram', 'kilograms'],
28
+ 'amu' : ['amu', 'atomicmassunit', 'atomicmassunits'],
29
+ 'eV' : ['ev', 'electronvolt', 'electronvolts'],
30
+ 'meV' : ['mev', 'millielectronvolt', 'millielectronvolts'],
31
+ 'J' : ['j', 'joule', 'joules'],
32
+ 'cal' : ['cal', 'calorie', 'calories'],
33
+ 'kcal' : ['kcal', 'kilocalorie', 'kilocalories'],
34
+ 'Ry' : ['ry', 'rydberg', 'rydbergs'],
35
+ 'cm-1' : ['cm^{-1}', 'cm1', 'cm-1', 'cm^-1'],
36
+ 'cm' : ['cm', 'centimeter', 'centimeters'],
37
+ 'A' : ['a', 'aa', 'angstrom', 'angstroms', 'armstrong', 'armstrongs'],
38
+ 'bohr' : ['bohr', 'bohrs', 'bohrradii'],
39
+ 'm' : ['m', 'meter', 'meters'],
40
+ 'deg' : ['deg', 'degree', 'degrees'],
41
+ 'rad' : ['rad', 'radian', 'radians'],
42
+ 'bar' : ['bar', 'bars'],
43
+ 'kbar' : ['kbar', 'kilobar', 'kilobars'],
44
+ 'Pa' : ['pa', 'pascal', 'pascals'],
45
+ 'GPa' : ['gpa', 'gigapascal', 'gigapascals'],
46
+ 's' : ['s', 'second', 'seconds'],
47
+ 'H' : ['h', 'hour', 'hours'],
48
+ }
49
+ '''
50
+ Dict with unit names.
51
+ '''
52
+
53
+
54
+ parameters = {
55
+ 'height': ['height', 'h'],
56
+ 'area' : ['area', 'a'],
57
+ }
58
+ '''Dict with different parameters.'''
59
+
60
+
61
+ experiments: dict = {
62
+ 'ins' : ['ins', 'inelasticneutronscattering', 'inelastic neutron scattering'],
63
+ 'atr' : ['atr', 'ftir', 'attenuatedtotalreflection', 'attenuated total reflection'],
64
+ 'raman' : ['raman'],
65
+ 'qens' : ['qens', 'quasielasticneutronscattering', 'quasielastic neutron scattering', 'quasi elastic neutron scattering'],
66
+ }
67
+ '''
68
+ Dictionary with the available experiment types.
69
+ '''
70
+
71
+
72
+ files = {
73
+ 'file' : ['file', 'files', 'f', 'filepath', 'file path', 'filename', 'file name'],
74
+ 'dir' : ['dir', 'directory', 'd', 'folder'],
75
+ 'error' : ['Error', 'error', 'ERROR', 'Errors', 'errors', 'ERRORS'],
76
+ }
77
+ '''
78
+ Strings related to files.
79
+ '''
80
+
81
+
82
+ boolean= {
83
+ True : ['yes', 'YES', 'Yes', 'Y', 'y', 'T', 'True', 'TRUE', 't', 'true', True, 'Si', 'SI', 'si', 'S', 's'],
84
+ False : ['no', 'NO', 'No', 'N', 'n', 'F', 'False', 'FALSE', 'f', 'false', False],
85
+ }
86
+ '''
87
+ Strings with booleans such as 'yes' / 'no'.
88
+ '''
89
+