picometer 0.1.0__tar.gz → 0.1.1__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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: picometer
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Precisely define and calculate measurements across multiple crystal structures
5
5
  License: MIT
6
6
  Author: Daniel Tchoń
@@ -19,22 +19,33 @@ Description-Content-Type: text/markdown
19
19
 
20
20
  # picometer
21
21
 
22
+ [![PyPI version](https://img.shields.io/pypi/v/picometer)](https://pypi.org/project/picometer/)
23
+ [![Python version](https://img.shields.io/pypi/pyversions/picometer.svg)](https://www.python.org/downloads/)
22
24
  [![codecov](https://codecov.io/gh/Baharis/picometer/graph/badge.svg?token=bWGMArFAR8)](https://codecov.io/gh/Baharis/picometer)
23
25
  [![CodeFactor](https://www.codefactor.io/repository/github/baharis/picometer/badge)](https://www.codefactor.io/repository/github/baharis/picometer)
24
26
  [![Documentation Status](https://readthedocs.org/projects/picometer/badge/?version=stable)](https://picometer.readthedocs.io/en/stable/?badge=stable)
27
+ [![Gitmoji](https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg)](https://gitmoji.dev)
28
+ [![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)
29
+
30
+ Picometer is a Python 3.10+ package which allows to define
31
+ and calculate various metrics across multiple crystal structures
32
+ in a clear and reproducible fashion.
33
+ It is supposed to be used in tandem with a GUI program
34
+ such as [Mercury](https://www.ccdc.cam.ac.uk/solutions/software/mercury/)
35
+ or [Olex2](https://www.olexsys.org/olex2/)
36
+ and applied on a series of cif files with consistent labelling.
25
37
 
26
- This is a little Python 3.10+ suite which aims to precisely define
27
- and calculate measurements across multiple crystal structures.
28
38
  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,
39
+ - Misclicked and lost your 250-atom selection,
40
+ - Tried to fit or calculate metrics for any plane or line,
31
41
  - Spent a day measuring distances and angles in tens of similar structures,
32
- - Had to redo measurements because of a offensively minor change,
42
+ - Had to redo measurements because of an offensively minor change,
33
43
 
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,
44
+ Instead of relying on a graphical interface, picometer reads settings
45
+ and instructions from an input [`.yaml`](https://en.wikipedia.org/wiki/YAML)
46
+ file to probe one or many consistently-named structures concurrently.
47
+ The results are output in a form
48
+ of a [`.csv`](https://en.wikipedia.org/wiki/Comma-separated_values) file,
38
49
  which can be then opened in a spreadsheet editor for further analysis.
39
50
  Because of that, picometer is a handy tool to save time
40
51
  on dumb repeatable labor and focus on what really matters.
@@ -42,16 +53,26 @@ on dumb repeatable labor and focus on what really matters.
42
53
 
43
54
  ## Installation
44
55
 
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:
56
+ If you are installing python solely to run picometer or are not concerned
57
+ about introducing additional dependencies,
58
+ installing picometer is as simple as running:
59
+ ```commandline
60
+ pip install picometer
61
+ ```
62
+
63
+ However, it is advised to install picometer in a designated
64
+ [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments).
65
+ This is best achieved by following the linked instructions,
66
+ but can be otherwise summarised as follows:
67
+ 1) Make sure you have Python 3.10+ installed:
68
+ `python --version`
69
+ 2) Create a virtual environment using i.e. venv:
49
70
  `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`
71
+ 3) Activate your virtual environment:
72
+ - Windows: `\path\to\virtual_environment\Scripts\activate`
73
+ - Unix/macOS: `source /path/to/virtual_environment/bin/activate`
74
+ 4) Install `picometer` and its dependencies: `pip install picometer`
75
+
55
76
 
56
77
  The code is currently updated with an intention to be available for download
57
78
  directly from pip:
@@ -67,7 +88,7 @@ created during installation following instructions therein.
67
88
  Running the program with no arguments produces the help string.
68
89
 
69
90
  ```shell
70
- python picometer_process.py
91
+ python -m picometer
71
92
  ```
72
93
  ```text
73
94
  usage: picometer [-h] filename
@@ -83,12 +104,15 @@ options:
83
104
  Author: Daniel Tchoń, baharis @ GitHub
84
105
  ```
85
106
 
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
107
+ Picometer inputs its settings and instructions from an input
108
+ [`.yaml`](https://en.wikipedia.org/wiki/YAML) file.
109
+ The file can contain a dictionary of `settings`,
110
+ as well as a list of `instructions`.
111
+ The list of instructions, called also a "routine", must include
112
+ only single-element maps in the `- instruction: detail`
113
+ or `- instruction: {details}` format.
114
+ Examples of instruction files are available in the `tests` directory.
115
+ The easiest way to generate your file is to prepare it based
92
116
  on the example provided.
93
117
 
94
118
 
@@ -123,15 +147,17 @@ The following instructions are currently supported by picometer:
123
147
 
124
148
  ## Contributing
125
149
 
126
- Interested in contributing? Check out the contributing guidelines.
127
- Please note that this project is released with a Code of Conduct.
150
+ Interested in contributing? Check out the
151
+ [contributing guidelines](CONTRIBUTING.md).
152
+ Please note that this project is released with
153
+ a [Code of Conduct](CONDUCT.md).
128
154
  By contributing to this project, you agree to abide by its terms.
129
155
 
130
156
 
131
157
  ## License
132
158
 
133
159
  `picometer` was created by Daniel Tchoń.
134
- It is licensed under the terms of the MIT license.
160
+ It is licensed under the terms of the [MIT license](LICENSE).
135
161
 
136
162
 
137
163
  ## Credits
@@ -144,5 +170,8 @@ All contributions and suggestions are heartily welcome!
144
170
  `picometer` was created with the help of
145
171
  [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/)
146
172
  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/).
173
+ It is published with the help of
174
+ [`poetry`](https://python-poetry.org/),
175
+ [Python Semantic Versioning](https://python-semantic-release.readthedocs.io/en/latest/),
176
+ and [Gitmoji](https://gitmoji.dev/).
148
177
 
@@ -1,21 +1,32 @@
1
1
  # picometer
2
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/)
3
5
  [![codecov](https://codecov.io/gh/Baharis/picometer/graph/badge.svg?token=bWGMArFAR8)](https://codecov.io/gh/Baharis/picometer)
4
6
  [![CodeFactor](https://www.codefactor.io/repository/github/baharis/picometer/badge)](https://www.codefactor.io/repository/github/baharis/picometer)
5
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.
6
18
 
7
- This is a little Python 3.10+ suite which aims to precisely define
8
- and calculate measurements across multiple crystal structures.
9
19
  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,
20
+ - Misclicked and lost your 250-atom selection,
21
+ - Tried to fit or calculate metrics for any plane or line,
12
22
  - Spent a day measuring distances and angles in tens of similar structures,
13
- - Had to redo measurements because of a offensively minor change,
23
+ - Had to redo measurements because of an offensively minor change,
14
24
 
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,
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,
19
30
  which can be then opened in a spreadsheet editor for further analysis.
20
31
  Because of that, picometer is a handy tool to save time
21
32
  on dumb repeatable labor and focus on what really matters.
@@ -23,16 +34,26 @@ on dumb repeatable labor and focus on what really matters.
23
34
 
24
35
  ## Installation
25
36
 
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:
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:
30
51
  `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`
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
+
36
57
 
37
58
  The code is currently updated with an intention to be available for download
38
59
  directly from pip:
@@ -48,7 +69,7 @@ created during installation following instructions therein.
48
69
  Running the program with no arguments produces the help string.
49
70
 
50
71
  ```shell
51
- python picometer_process.py
72
+ python -m picometer
52
73
  ```
53
74
  ```text
54
75
  usage: picometer [-h] filename
@@ -64,12 +85,15 @@ options:
64
85
  Author: Daniel Tchoń, baharis @ GitHub
65
86
  ```
66
87
 
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
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
73
97
  on the example provided.
74
98
 
75
99
 
@@ -104,15 +128,17 @@ The following instructions are currently supported by picometer:
104
128
 
105
129
  ## Contributing
106
130
 
107
- Interested in contributing? Check out the contributing guidelines.
108
- Please note that this project is released with a Code of Conduct.
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](CONDUCT.md).
109
135
  By contributing to this project, you agree to abide by its terms.
110
136
 
111
137
 
112
138
  ## License
113
139
 
114
140
  `picometer` was created by Daniel Tchoń.
115
- It is licensed under the terms of the MIT license.
141
+ It is licensed under the terms of the [MIT license](LICENSE).
116
142
 
117
143
 
118
144
  ## Credits
@@ -125,4 +151,7 @@ All contributions and suggestions are heartily welcome!
125
151
  `picometer` was created with the help of
126
152
  [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/)
127
153
  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/).
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/).
@@ -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())
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "picometer"
3
- version = "0.1.0"
3
+ version = "0.1.1"
4
4
  description = "Precisely define and calculate measurements across multiple crystal structures"
5
5
  authors = ["Daniel Tchoń"]
6
6
  license = "MIT"
@@ -25,14 +25,18 @@ myst-nb = {version = ">=1.1.2", python = ">=3.10"}
25
25
  sphinx-autoapi = ">=3.3.2"
26
26
  sphinx-rtd-theme = ">=3.0.1"
27
27
  jupyter = ">=1.1.0"
28
+ python-semantic-release = {version = "^9.11.1", python = "^3.10"}
28
29
 
29
30
  [tool.semantic_release]
30
- version_toml = [
31
- "pyproject.toml:tool.poetry.version",
32
- ] # version location
33
- branch = "main" # branch to make releases of
34
- changelog_file = "CHANGELOG.md" # changelog file
35
- build_command = "pip install poetry && poetry build" # build dists
31
+ version_toml = ["pyproject.toml:tool.poetry.version", ] # version location
32
+ branch = "master" # branch to make releases of
33
+ changelog_file = "CHANGELOG.md" # changelog file
34
+ build_command = "pip install poetry && poetry build" # build dists
35
+ commit_parser = "emoji" # default EmojiCommitParser
36
+
37
+ [tool.semantic_release.branches]
38
+ master = { publish = true } # Stable release branch (master)
39
+ development = { publish = false } # Used for version checking only
36
40
 
37
41
  [build-system]
38
42
  requires = ["poetry-core>=1.0.0"]
File without changes
File without changes
File without changes
File without changes