mlgidbase 0.0.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 mlgid
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.
@@ -0,0 +1,106 @@
1
+ Metadata-Version: 2.4
2
+ Name: mlgidbase
3
+ Version: 0.0.1
4
+ Summary: A comprehensive toolbox for grazing-incidence diffraction
5
+ Author-email: Ainur Abukaev <ainurabukaev@gmail.com>
6
+ Project-URL: Homepage, https://github.com/mlgid-project/mlgidBASE
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: pygid==0.2.7
11
+ Requires-Dist: mlgiddetect==0.2.1
12
+ Requires-Dist: pygidfit==0.1.2
13
+ Requires-Dist: mlgidmatch==0.1.2
14
+ Dynamic: license-file
15
+
16
+ # mlgidBASE
17
+ [![Python version](https://img.shields.io/badge/python-3.9%7C3.10%7C3.11%7C3.12%7C3.13%7C3.14-blue.svg)](https://www.python.org/)
18
+
19
+ `mlgidBASE` is a Python package for machine learning–driven analysis of grazing-incidence wide-angle X-ray scattering (GIWAXS) data. It provides a full workflow from peak detection to matching with known crystal structures.
20
+
21
+ The package builds on the following components:
22
+
23
+ - [mlgidDETECT](https://github.com/mlgid-project/mlgidDETECT) — for peak detection
24
+ - [pygidFIT](https://github.com/mlgid-project/pygidFIT) — for two-dimensional peak fitting
25
+ - [mlgidMATCH](https://github.com/mlgid-project/mlgidMATCH_private) — for matching experimental peaks to known structures
26
+
27
+ ---
28
+
29
+ ## Key Features
30
+
31
+ - **Initialization**
32
+ Can be created from a [`pygid.Conversion`](./docs/tutorials/tutorial_05_from_memory.ipynb) object or loaded directly from a [NeXus file](./docs/tutorials/tutorial_01_initialization.ipynb).
33
+
34
+ - **Methods**
35
+ Provides functions for:
36
+ - [Peak detection](./docs/tutorials/tutorial_02_detection.ipynb)
37
+ - [Peak fitting](./docs/tutorials/tutorial_03_fitting.ipynb)
38
+ - [Peak matching](./docs/tutorials/tutorial_04_matching.ipynb)
39
+
40
+ - **Visualization**
41
+ Supports [visualization](./docs/tutorials/tutorial_06_visualization.ipynb) at all stages of the analysis pipeline.
42
+
43
+ - **Peak Adjustment**
44
+ Includes functions to [add or delete peaks](./docs/tutorials/tutorial_07_peak_operations.ipynb), either interactively or programmatically.
45
+
46
+ - **Data Access**
47
+ Enables [retrieving analysis results](./docs/tutorials/tutorial_08_get_data.ipynb) from the NeXus file for further processing.
48
+
49
+ ---
50
+
51
+ ## Installation
52
+
53
+ ### Install using pip
54
+
55
+ ```bash
56
+ pip install pygid
57
+ ```
58
+
59
+ ### Install from source
60
+
61
+ First, clone the repository:
62
+
63
+ ```bash
64
+ git clone https://github.com/mlgid-project/mlgidBASE.git
65
+ ```
66
+
67
+ Then navigate to the project directory and install it in editable mode:
68
+ ```bash
69
+ cd mlgidBASE
70
+ pip install -e .
71
+ ```
72
+
73
+ #### Required Python version: 3.12
74
+
75
+ ---
76
+
77
+ ## How to Use
78
+
79
+ For full details, see the dedicated [tutorials](./docs/tutorials).
80
+
81
+ ### Quick Start
82
+ ```python
83
+ from mlgidbase import mlgidBASE
84
+
85
+ # Initialize analysis from a NeXus file
86
+ filename = r'./example/BA2PbI4.h5'
87
+ analysis = mlgidBASE(filename=filename)
88
+
89
+ # Run peak detection
90
+ analysis.run_detection()
91
+
92
+ # Run peak fitting
93
+ analysis.run_fitting()
94
+
95
+ # Run peak matching with preprocessed CIFs
96
+ analysis.run_matching(
97
+ cif_prepr='./example/prepr_cifs.pickle'
98
+ )
99
+ ```
100
+
101
+ ### Data Format
102
+
103
+ The structure of the analysis results saved in the NeXus file is documented in the output file format
104
+ [guide](docs/tutorials/output_file_format.md).
105
+
106
+ It describes how entries, frames, and peak information are stored for further inspection or processing.
@@ -0,0 +1,91 @@
1
+ # mlgidBASE
2
+ [![Python version](https://img.shields.io/badge/python-3.9%7C3.10%7C3.11%7C3.12%7C3.13%7C3.14-blue.svg)](https://www.python.org/)
3
+
4
+ `mlgidBASE` is a Python package for machine learning–driven analysis of grazing-incidence wide-angle X-ray scattering (GIWAXS) data. It provides a full workflow from peak detection to matching with known crystal structures.
5
+
6
+ The package builds on the following components:
7
+
8
+ - [mlgidDETECT](https://github.com/mlgid-project/mlgidDETECT) — for peak detection
9
+ - [pygidFIT](https://github.com/mlgid-project/pygidFIT) — for two-dimensional peak fitting
10
+ - [mlgidMATCH](https://github.com/mlgid-project/mlgidMATCH_private) — for matching experimental peaks to known structures
11
+
12
+ ---
13
+
14
+ ## Key Features
15
+
16
+ - **Initialization**
17
+ Can be created from a [`pygid.Conversion`](./docs/tutorials/tutorial_05_from_memory.ipynb) object or loaded directly from a [NeXus file](./docs/tutorials/tutorial_01_initialization.ipynb).
18
+
19
+ - **Methods**
20
+ Provides functions for:
21
+ - [Peak detection](./docs/tutorials/tutorial_02_detection.ipynb)
22
+ - [Peak fitting](./docs/tutorials/tutorial_03_fitting.ipynb)
23
+ - [Peak matching](./docs/tutorials/tutorial_04_matching.ipynb)
24
+
25
+ - **Visualization**
26
+ Supports [visualization](./docs/tutorials/tutorial_06_visualization.ipynb) at all stages of the analysis pipeline.
27
+
28
+ - **Peak Adjustment**
29
+ Includes functions to [add or delete peaks](./docs/tutorials/tutorial_07_peak_operations.ipynb), either interactively or programmatically.
30
+
31
+ - **Data Access**
32
+ Enables [retrieving analysis results](./docs/tutorials/tutorial_08_get_data.ipynb) from the NeXus file for further processing.
33
+
34
+ ---
35
+
36
+ ## Installation
37
+
38
+ ### Install using pip
39
+
40
+ ```bash
41
+ pip install pygid
42
+ ```
43
+
44
+ ### Install from source
45
+
46
+ First, clone the repository:
47
+
48
+ ```bash
49
+ git clone https://github.com/mlgid-project/mlgidBASE.git
50
+ ```
51
+
52
+ Then navigate to the project directory and install it in editable mode:
53
+ ```bash
54
+ cd mlgidBASE
55
+ pip install -e .
56
+ ```
57
+
58
+ #### Required Python version: 3.12
59
+
60
+ ---
61
+
62
+ ## How to Use
63
+
64
+ For full details, see the dedicated [tutorials](./docs/tutorials).
65
+
66
+ ### Quick Start
67
+ ```python
68
+ from mlgidbase import mlgidBASE
69
+
70
+ # Initialize analysis from a NeXus file
71
+ filename = r'./example/BA2PbI4.h5'
72
+ analysis = mlgidBASE(filename=filename)
73
+
74
+ # Run peak detection
75
+ analysis.run_detection()
76
+
77
+ # Run peak fitting
78
+ analysis.run_fitting()
79
+
80
+ # Run peak matching with preprocessed CIFs
81
+ analysis.run_matching(
82
+ cif_prepr='./example/prepr_cifs.pickle'
83
+ )
84
+ ```
85
+
86
+ ### Data Format
87
+
88
+ The structure of the analysis results saved in the NeXus file is documented in the output file format
89
+ [guide](docs/tutorials/output_file_format.md).
90
+
91
+ It describes how entries, frames, and peak information are stored for further inspection or processing.
@@ -0,0 +1,30 @@
1
+ import os
2
+ import sys
3
+ sys.path.insert(0, os.path.abspath('..'))
4
+
5
+ project = 'mlgidBASE'
6
+ author = 'Ainur Abukaev'
7
+ release = '0.1.0'
8
+
9
+ extensions = [
10
+ 'sphinx.ext.autodoc',
11
+ 'sphinx.ext.napoleon',
12
+ 'nbsphinx',
13
+ 'myst_nb',
14
+ ]
15
+
16
+ templates_path = ['_templates']
17
+ exclude_patterns = ['_build', '**.ipynb_checkpoints']
18
+
19
+ html_theme = 'sphinx_rtd_theme'
20
+ html_static_path = ['_static']
21
+
22
+ tutorial_dir = os.path.join(os.path.dirname(__file__), 'tutorials')
23
+ tutorials = sorted(f for f in os.listdir(tutorial_dir) if f.endswith('.ipynb'))
24
+ tutorial_names = [os.path.splitext(f)[0] for f in tutorials]
25
+
26
+ toctree_path = os.path.join(os.path.dirname(__file__), 'tutorials_toctree.rst')
27
+ with open(toctree_path, 'w', encoding='utf-8') as f:
28
+ f.write("Tutorials\n=========\n\n.. toctree::\n :maxdepth: 2\n\n")
29
+ for name in tutorial_names:
30
+ f.write(f" tutorials/{name}\n")
@@ -0,0 +1,7 @@
1
+ # from .expparams import ExpParams
2
+ # from .dataloader import DataLoader
3
+ # from .datasaver import DataSaver, ExpMetadata, SampleMetadata
4
+ # from .coordmaps import CoordMaps
5
+ # from .conversion import Conversion
6
+ from .main import mlgidBASE
7
+ __version__ = "0.0.1"