picometer 0.1.0__tar.gz → 0.1.2__tar.gz

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.
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Daniel Tchoń
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Daniel Tchoń
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: picometer
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Precisely define and calculate measurements across multiple crystal structures
5
5
  License: MIT
6
6
  Author: Daniel Tchoń
@@ -10,31 +10,43 @@ Classifier: Programming Language :: Python :: 3
10
10
  Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
- Requires-Dist: hikari-toolkit (==0.2.3)
14
- Requires-Dist: numpy (>=2.1.2)
15
- Requires-Dist: pandas (>=2.2.3)
16
- Requires-Dist: pyyaml (>=6.0.2)
17
- Requires-Dist: uncertainties (>=3.2.2)
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Requires-Dist: hikari-toolkit (>=0.2.3)
15
+ Requires-Dist: numpy (>=2)
16
+ Requires-Dist: pandas (>=2)
17
+ Requires-Dist: pyyaml (>=5)
18
+ Requires-Dist: uncertainties (>=3)
18
19
  Description-Content-Type: text/markdown
19
20
 
20
21
  # picometer
21
22
 
23
+ [![PyPI version](https://img.shields.io/pypi/v/picometer)](https://pypi.org/project/picometer/)
24
+ [![Python version](https://img.shields.io/pypi/pyversions/picometer.svg)](https://www.python.org/downloads/)
22
25
  [![codecov](https://codecov.io/gh/Baharis/picometer/graph/badge.svg?token=bWGMArFAR8)](https://codecov.io/gh/Baharis/picometer)
23
26
  [![CodeFactor](https://www.codefactor.io/repository/github/baharis/picometer/badge)](https://www.codefactor.io/repository/github/baharis/picometer)
24
27
  [![Documentation Status](https://readthedocs.org/projects/picometer/badge/?version=stable)](https://picometer.readthedocs.io/en/stable/?badge=stable)
28
+ [![Gitmoji](https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg)](https://gitmoji.dev)
29
+ [![tests](https://github.com/Baharis/picometer/actions/workflows/ci-cd.yml/badge.svg?branch=master)](https://github.com/Baharis/picometer/actions/workflows/ci-cd.yml)
30
+
31
+ Picometer is a Python 3.10+ package which allows to define
32
+ and calculate various metrics across multiple crystal structures
33
+ in a clear and reproducible fashion.
34
+ It is supposed to be used in tandem with a GUI program
35
+ such as [Mercury](https://www.ccdc.cam.ac.uk/solutions/software/mercury/)
36
+ or [Olex2](https://www.olexsys.org/olex2/)
37
+ and applied on a series of cif files with consistent labelling.
25
38
 
26
- This is a little Python 3.10+ suite which aims to precisely define
27
- and calculate measurements across multiple crystal structures.
28
39
  This is a software for you if you have ever:
29
- - Misclicked an atom and lost your 250-atom selection in Olex2,
30
- - Tried to fit or calculate distances to a line in Mercury,
40
+ - Misclicked and lost your 250-atom selection,
41
+ - Tried to fit or calculate metrics for any plane or line,
31
42
  - Spent a day measuring distances and angles in tens of similar structures,
32
- - Had to redo measurements because of a offensively minor change,
43
+ - Had to redo measurements because of an offensively minor change,
33
44
 
34
- Instead of relying on a graphical interface and evaluating a single structure
35
- at a time, picometer uses an input yaml file with individual settings
36
- and consecutive instructions to probe multiple structures concurrently.
37
- The results are output in a form of a csv file,
45
+ Instead of relying on a graphical interface, picometer reads settings
46
+ and instructions from an input [`.yaml`](https://en.wikipedia.org/wiki/YAML)
47
+ file to probe one or many consistently-named structures concurrently.
48
+ The results are output in a form
49
+ of a [`.csv`](https://en.wikipedia.org/wiki/Comma-separated_values) file,
38
50
  which can be then opened in a spreadsheet editor for further analysis.
39
51
  Because of that, picometer is a handy tool to save time
40
52
  on dumb repeatable labor and focus on what really matters.
@@ -42,16 +54,26 @@ on dumb repeatable labor and focus on what really matters.
42
54
 
43
55
  ## Installation
44
56
 
45
- In order to use picometer:
46
- 1) Clone (download) the git repository to your computer;
47
- 2) Make sure you have Python version 3.10+ installed;
48
- 3) Create a virtual environment using i.e. venv:
57
+ If you are installing python solely to run picometer or are not concerned
58
+ about introducing additional dependencies,
59
+ installing picometer is as simple as running:
60
+ ```commandline
61
+ pip install picometer
62
+ ```
63
+
64
+ However, it is advised to install picometer in a designated
65
+ [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments).
66
+ This is best achieved by following the linked instructions,
67
+ but can be otherwise summarised as follows:
68
+ 1) Make sure you have Python 3.10+ installed:
69
+ `python --version`
70
+ 2) Create a virtual environment using i.e. venv:
49
71
  `python -m venv /path/to/virtual_environment`
50
- 4) Activate your virtual environment:
51
- use `/path/to/virtual_environment` on Windows or
52
- `source /path/to/virtual_environment` on Linux/MacOS;
53
- 5) Install required python packages: `pip install -r requirements.txt`
54
- 6) Test your installation by running `python -m unittest`
72
+ 3) Activate your virtual environment:
73
+ - Windows: `\path\to\virtual_environment\Scripts\activate`
74
+ - Unix/macOS: `source /path/to/virtual_environment/bin/activate`
75
+ 4) Install `picometer` and its dependencies: `pip install picometer`
76
+
55
77
 
56
78
  The code is currently updated with an intention to be available for download
57
79
  directly from pip:
@@ -67,7 +89,7 @@ created during installation following instructions therein.
67
89
  Running the program with no arguments produces the help string.
68
90
 
69
91
  ```shell
70
- python picometer_process.py
92
+ python -m picometer
71
93
  ```
72
94
  ```text
73
95
  usage: picometer [-h] filename
@@ -83,12 +105,15 @@ options:
83
105
  Author: Daniel Tchoń, baharis @ GitHub
84
106
  ```
85
107
 
86
- In order to know what to do, picometer requires an input file
87
- with (settings and) instructions. This file should follow yaml format
88
- and the list of instructions, called "routine", must include
89
- only single-element maps in the `instruction: details` format.
90
- An example of instruction file is available in `tests` directory.
91
- The easiest way to generate your file is to manually write it based
108
+ Picometer inputs its settings and instructions from an input
109
+ [`.yaml`](https://en.wikipedia.org/wiki/YAML) file.
110
+ The file can contain a dictionary of `settings`,
111
+ as well as a list of `instructions`.
112
+ The list of instructions, called also a "routine", must include
113
+ only single-element maps in the `- instruction: detail`
114
+ or `- instruction: {details}` format.
115
+ Examples of instruction files are available in the `tests` directory.
116
+ The easiest way to generate your file is to prepare it based
92
117
  on the example provided.
93
118
 
94
119
 
@@ -123,15 +148,17 @@ The following instructions are currently supported by picometer:
123
148
 
124
149
  ## Contributing
125
150
 
126
- Interested in contributing? Check out the contributing guidelines.
127
- Please note that this project is released with a Code of Conduct.
151
+ Interested in contributing? Check out the
152
+ [contributing guidelines](CONTRIBUTING.md).
153
+ Please note that this project is released with
154
+ a [Code of Conduct](CODE_OF_CONDUCT).
128
155
  By contributing to this project, you agree to abide by its terms.
129
156
 
130
157
 
131
158
  ## License
132
159
 
133
160
  `picometer` was created by Daniel Tchoń.
134
- It is licensed under the terms of the MIT license.
161
+ It is licensed under the terms of the [MIT license](LICENSE).
135
162
 
136
163
 
137
164
  ## Credits
@@ -144,5 +171,8 @@ All contributions and suggestions are heartily welcome!
144
171
  `picometer` was created with the help of
145
172
  [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/)
146
173
  and the `py-pkgs-cookiecutter` [template](https://github.com/py-pkgs/py-pkgs-cookiecutter).
147
- It is published with the help of [`poetry`](https://python-poetry.org/).
174
+ It is published with the help of
175
+ [`poetry`](https://python-poetry.org/),
176
+ [Python Semantic Versioning](https://python-semantic-release.readthedocs.io/en/latest/),
177
+ and [Gitmoji](https://gitmoji.dev/).
148
178
 
@@ -1,128 +1,157 @@
1
- # picometer
2
-
3
- [![codecov](https://codecov.io/gh/Baharis/picometer/graph/badge.svg?token=bWGMArFAR8)](https://codecov.io/gh/Baharis/picometer)
4
- [![CodeFactor](https://www.codefactor.io/repository/github/baharis/picometer/badge)](https://www.codefactor.io/repository/github/baharis/picometer)
5
- [![Documentation Status](https://readthedocs.org/projects/picometer/badge/?version=stable)](https://picometer.readthedocs.io/en/stable/?badge=stable)
6
-
7
- This is a little Python 3.10+ suite which aims to precisely define
8
- and calculate measurements across multiple crystal structures.
9
- This is a software for you if you have ever:
10
- - Misclicked an atom and lost your 250-atom selection in Olex2,
11
- - Tried to fit or calculate distances to a line in Mercury,
12
- - Spent a day measuring distances and angles in tens of similar structures,
13
- - Had to redo measurements because of a offensively minor change,
14
-
15
- Instead of relying on a graphical interface and evaluating a single structure
16
- at a time, picometer uses an input yaml file with individual settings
17
- and consecutive instructions to probe multiple structures concurrently.
18
- The results are output in a form of a csv file,
19
- which can be then opened in a spreadsheet editor for further analysis.
20
- Because of that, picometer is a handy tool to save time
21
- on dumb repeatable labor and focus on what really matters.
22
-
23
-
24
- ## Installation
25
-
26
- In order to use picometer:
27
- 1) Clone (download) the git repository to your computer;
28
- 2) Make sure you have Python version 3.10+ installed;
29
- 3) Create a virtual environment using i.e. venv:
30
- `python -m venv /path/to/virtual_environment`
31
- 4) Activate your virtual environment:
32
- use `/path/to/virtual_environment` on Windows or
33
- `source /path/to/virtual_environment` on Linux/MacOS;
34
- 5) Install required python packages: `pip install -r requirements.txt`
35
- 6) Test your installation by running `python -m unittest`
36
-
37
- The code is currently updated with an intention to be available for download
38
- directly from pip:
39
- ```bash
40
- $ pip install picometer
41
- ```
42
-
43
-
44
- ## Usage
45
-
46
- Whenever you want to use picometer, first re-activate the virtual environment
47
- created during installation following instructions therein.
48
- Running the program with no arguments produces the help string.
49
-
50
- ```shell
51
- python picometer_process.py
52
- ```
53
- ```text
54
- usage: picometer [-h] filename
55
-
56
- Precisely define and measure across multiple crystal structures
57
-
58
- positional arguments:
59
- filename Path to yaml file with routine settings and instructions
60
-
61
- options:
62
- -h, --help show this help message and exit
63
-
64
- Author: Daniel Tchoń, baharis @ GitHub
65
- ```
66
-
67
- In order to know what to do, picometer requires an input file
68
- with (settings and) instructions. This file should follow yaml format
69
- and the list of instructions, called "routine", must include
70
- only single-element maps in the `instruction: details` format.
71
- An example of instruction file is available in `tests` directory.
72
- The easiest way to generate your file is to manually write it based
73
- on the example provided.
74
-
75
-
76
- ## Instructions
77
-
78
- The following instructions are currently supported by picometer:
79
- - **Input/output instructions**
80
- - `load` model from a cif file, given `filename` or mapping syntax:
81
- `{path: filename.cif, block: cif_block}`.
82
- - `write` table with all evaluations to a csv file.
83
- - **Selection instructions**
84
- - `select` atoms, groups, or shapes to be used; use raw element names
85
- or provide symmetry relation / recenter using mapping syntax, for example:
86
- `{label: C(11), symm: x;-y;z+1/2, at: Fe(1)}`.
87
- By default, selection is cleared after calling `select` with no arguments
88
- or calling an aggregating or evaluating instruction.
89
- - `recenter` selection around a new centroid;
90
- this action is applied to every selected item individually,
91
- so to recenter fixed group of atoms, `group` them first and recenter
92
- this group - otherwise you will recenter individual atoms instead.
93
- - **Aggregation instructions**
94
- - `group` current selection into a new object with fixed elements.
95
- - fit `centroid` to the current atom / centroid selection;
96
- - fit `line` to the current atom / centroid selection;
97
- - fit `plane` to the currect atom / centroid selection;
98
- - **Evaluation instructions**
99
- - measure `distance` between 2 selected objects; if the selection includes
100
- groups of atoms, measure closes distance to the group of atoms.
101
- - measure `angle` between 2–6 selected objects; if the selection includes
102
- (ordered) atoms, calculate direct or dihedral angle between presumed bonds.
103
-
104
-
105
- ## Contributing
106
-
107
- Interested in contributing? Check out the contributing guidelines.
108
- Please note that this project is released with a Code of Conduct.
109
- By contributing to this project, you agree to abide by its terms.
110
-
111
-
112
- ## License
113
-
114
- `picometer` was created by Daniel Tchoń.
115
- It is licensed under the terms of the MIT license.
116
-
117
-
118
- ## Credits
119
-
120
- This software has been written as a hobby project of Daniel Tchoń
121
- (email: dtchon at lbl dot gov, or other address currectly available on
122
- https://dtools.pl/about/).
123
- All contributions and suggestions are heartily welcome!
124
-
125
- `picometer` was created with the help of
126
- [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/)
127
- and the `py-pkgs-cookiecutter` [template](https://github.com/py-pkgs/py-pkgs-cookiecutter).
128
- It is published with the help of [`poetry`](https://python-poetry.org/).
1
+ # picometer
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/picometer)](https://pypi.org/project/picometer/)
4
+ [![Python version](https://img.shields.io/pypi/pyversions/picometer.svg)](https://www.python.org/downloads/)
5
+ [![codecov](https://codecov.io/gh/Baharis/picometer/graph/badge.svg?token=bWGMArFAR8)](https://codecov.io/gh/Baharis/picometer)
6
+ [![CodeFactor](https://www.codefactor.io/repository/github/baharis/picometer/badge)](https://www.codefactor.io/repository/github/baharis/picometer)
7
+ [![Documentation Status](https://readthedocs.org/projects/picometer/badge/?version=stable)](https://picometer.readthedocs.io/en/stable/?badge=stable)
8
+ [![Gitmoji](https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg)](https://gitmoji.dev)
9
+ [![tests](https://github.com/Baharis/picometer/actions/workflows/ci-cd.yml/badge.svg?branch=master)](https://github.com/Baharis/picometer/actions/workflows/ci-cd.yml)
10
+
11
+ Picometer is a Python 3.10+ package which allows to define
12
+ and calculate various metrics across multiple crystal structures
13
+ in a clear and reproducible fashion.
14
+ It is supposed to be used in tandem with a GUI program
15
+ such as [Mercury](https://www.ccdc.cam.ac.uk/solutions/software/mercury/)
16
+ or [Olex2](https://www.olexsys.org/olex2/)
17
+ and applied on a series of cif files with consistent labelling.
18
+
19
+ This is a software for you if you have ever:
20
+ - Misclicked and lost your 250-atom selection,
21
+ - Tried to fit or calculate metrics for any plane or line,
22
+ - Spent a day measuring distances and angles in tens of similar structures,
23
+ - Had to redo measurements because of an offensively minor change,
24
+
25
+ Instead of relying on a graphical interface, picometer reads settings
26
+ and instructions from an input [`.yaml`](https://en.wikipedia.org/wiki/YAML)
27
+ file to probe one or many consistently-named structures concurrently.
28
+ The results are output in a form
29
+ of a [`.csv`](https://en.wikipedia.org/wiki/Comma-separated_values) file,
30
+ which can be then opened in a spreadsheet editor for further analysis.
31
+ Because of that, picometer is a handy tool to save time
32
+ on dumb repeatable labor and focus on what really matters.
33
+
34
+
35
+ ## Installation
36
+
37
+ If you are installing python solely to run picometer or are not concerned
38
+ about introducing additional dependencies,
39
+ installing picometer is as simple as running:
40
+ ```commandline
41
+ pip install picometer
42
+ ```
43
+
44
+ However, it is advised to install picometer in a designated
45
+ [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments).
46
+ This is best achieved by following the linked instructions,
47
+ but can be otherwise summarised as follows:
48
+ 1) Make sure you have Python 3.10+ installed:
49
+ `python --version`
50
+ 2) Create a virtual environment using i.e. venv:
51
+ `python -m venv /path/to/virtual_environment`
52
+ 3) Activate your virtual environment:
53
+ - Windows: `\path\to\virtual_environment\Scripts\activate`
54
+ - Unix/macOS: `source /path/to/virtual_environment/bin/activate`
55
+ 4) Install `picometer` and its dependencies: `pip install picometer`
56
+
57
+
58
+ The code is currently updated with an intention to be available for download
59
+ directly from pip:
60
+ ```bash
61
+ $ pip install picometer
62
+ ```
63
+
64
+
65
+ ## Usage
66
+
67
+ Whenever you want to use picometer, first re-activate the virtual environment
68
+ created during installation following instructions therein.
69
+ Running the program with no arguments produces the help string.
70
+
71
+ ```shell
72
+ python -m picometer
73
+ ```
74
+ ```text
75
+ usage: picometer [-h] filename
76
+
77
+ Precisely define and measure across multiple crystal structures
78
+
79
+ positional arguments:
80
+ filename Path to yaml file with routine settings and instructions
81
+
82
+ options:
83
+ -h, --help show this help message and exit
84
+
85
+ Author: Daniel Tchoń, baharis @ GitHub
86
+ ```
87
+
88
+ Picometer inputs its settings and instructions from an input
89
+ [`.yaml`](https://en.wikipedia.org/wiki/YAML) file.
90
+ The file can contain a dictionary of `settings`,
91
+ as well as a list of `instructions`.
92
+ The list of instructions, called also a "routine", must include
93
+ only single-element maps in the `- instruction: detail`
94
+ or `- instruction: {details}` format.
95
+ Examples of instruction files are available in the `tests` directory.
96
+ The easiest way to generate your file is to prepare it based
97
+ on the example provided.
98
+
99
+
100
+ ## Instructions
101
+
102
+ The following instructions are currently supported by picometer:
103
+ - **Input/output instructions**
104
+ - `load` model from a cif file, given `filename` or mapping syntax:
105
+ `{path: filename.cif, block: cif_block}`.
106
+ - `write` table with all evaluations to a csv file.
107
+ - **Selection instructions**
108
+ - `select` atoms, groups, or shapes to be used; use raw element names
109
+ or provide symmetry relation / recenter using mapping syntax, for example:
110
+ `{label: C(11), symm: x;-y;z+1/2, at: Fe(1)}`.
111
+ By default, selection is cleared after calling `select` with no arguments
112
+ or calling an aggregating or evaluating instruction.
113
+ - `recenter` selection around a new centroid;
114
+ this action is applied to every selected item individually,
115
+ so to recenter fixed group of atoms, `group` them first and recenter
116
+ this group - otherwise you will recenter individual atoms instead.
117
+ - **Aggregation instructions**
118
+ - `group` current selection into a new object with fixed elements.
119
+ - fit `centroid` to the current atom / centroid selection;
120
+ - fit `line` to the current atom / centroid selection;
121
+ - fit `plane` to the currect atom / centroid selection;
122
+ - **Evaluation instructions**
123
+ - measure `distance` between 2 selected objects; if the selection includes
124
+ groups of atoms, measure closes distance to the group of atoms.
125
+ - measure `angle` between 2–6 selected objects; if the selection includes
126
+ (ordered) atoms, calculate direct or dihedral angle between presumed bonds.
127
+
128
+
129
+ ## Contributing
130
+
131
+ Interested in contributing? Check out the
132
+ [contributing guidelines](CONTRIBUTING.md).
133
+ Please note that this project is released with
134
+ a [Code of Conduct](CODE_OF_CONDUCT).
135
+ By contributing to this project, you agree to abide by its terms.
136
+
137
+
138
+ ## License
139
+
140
+ `picometer` was created by Daniel Tchoń.
141
+ It is licensed under the terms of the [MIT license](LICENSE).
142
+
143
+
144
+ ## Credits
145
+
146
+ This software has been written as a hobby project of Daniel Tchoń
147
+ (email: dtchon at lbl dot gov, or other address currectly available on
148
+ https://dtools.pl/about/).
149
+ All contributions and suggestions are heartily welcome!
150
+
151
+ `picometer` was created with the help of
152
+ [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/)
153
+ and the `py-pkgs-cookiecutter` [template](https://github.com/py-pkgs/py-pkgs-cookiecutter).
154
+ It is published with the help of
155
+ [`poetry`](https://python-poetry.org/),
156
+ [Python Semantic Versioning](https://python-semantic-release.readthedocs.io/en/latest/),
157
+ and [Gitmoji](https://gitmoji.dev/).
@@ -1,4 +1,4 @@
1
- # read version from installed package
2
- from importlib.metadata import version
3
-
4
- __version__ = version("picometer")
1
+ # read version from installed package
2
+ from importlib.metadata import version
3
+
4
+ __version__ = version("picometer")
@@ -0,0 +1,29 @@
1
+ from argparse import ArgumentParser, Namespace
2
+ from picometer.routine import Routine
3
+ from picometer.process import process
4
+ import sys
5
+
6
+
7
+ def parse_args() -> Namespace:
8
+ """Parse provided arguments if program was run directly from the CLI"""
9
+ desc = 'Precisely define and measure across multiple crystal structures'
10
+ author = 'Author: Daniel Tchoń, baharis @ GitHub'
11
+ ap = ArgumentParser(prog='picometer', description=desc, epilog=author)
12
+ ap.add_argument('filename', help='Path to yaml file with routine '
13
+ 'settings and instructions')
14
+ if len(sys.argv) == 1:
15
+ ap.print_help(sys.stderr)
16
+ sys.exit(1)
17
+ return ap.parse_args()
18
+
19
+
20
+ def main() -> int:
21
+ args = parse_args()
22
+ if filename := args.filename:
23
+ routine = Routine.from_yaml(filename)
24
+ process(routine)
25
+ return 0
26
+
27
+
28
+ if __name__ == '__main__':
29
+ sys.exit(main())