iden 0.0.1a0__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.
- iden-0.0.1a0/LICENSE +28 -0
- iden-0.0.1a0/PKG-INFO +145 -0
- iden-0.0.1a0/README.md +111 -0
- iden-0.0.1a0/pyproject.toml +263 -0
- iden-0.0.1a0/src/iden/__init__.py +1 -0
- iden-0.0.1a0/src/iden/constants.py +10 -0
- iden-0.0.1a0/src/iden/dataset/__init__.py +9 -0
- iden-0.0.1a0/src/iden/dataset/base.py +540 -0
- iden-0.0.1a0/src/iden/dataset/exceptions.py +17 -0
- iden-0.0.1a0/src/iden/dataset/loader/__init__.py +17 -0
- iden-0.0.1a0/src/iden/dataset/loader/base.py +167 -0
- iden-0.0.1a0/src/iden/dataset/loader/vanilla.py +23 -0
- iden-0.0.1a0/src/iden/dataset/loading.py +37 -0
- iden-0.0.1a0/src/iden/dataset/vanilla.py +423 -0
- iden-0.0.1a0/src/iden/io/__init__.py +52 -0
- iden-0.0.1a0/src/iden/io/auto.py +133 -0
- iden-0.0.1a0/src/iden/io/base.py +219 -0
- iden-0.0.1a0/src/iden/io/json.py +132 -0
- iden-0.0.1a0/src/iden/io/pickle.py +141 -0
- iden-0.0.1a0/src/iden/io/safetensors/__init__.py +23 -0
- iden-0.0.1a0/src/iden/io/safetensors/loaders.py +69 -0
- iden-0.0.1a0/src/iden/io/safetensors/savers.py +71 -0
- iden-0.0.1a0/src/iden/io/text.py +139 -0
- iden-0.0.1a0/src/iden/io/torch.py +145 -0
- iden-0.0.1a0/src/iden/io/utils.py +36 -0
- iden-0.0.1a0/src/iden/io/yaml.py +134 -0
- iden-0.0.1a0/src/iden/shard/__init__.py +41 -0
- iden-0.0.1a0/src/iden/shard/base.py +43 -0
- iden-0.0.1a0/src/iden/shard/collection/__init__.py +8 -0
- iden-0.0.1a0/src/iden/shard/collection/dict.py +329 -0
- iden-0.0.1a0/src/iden/shard/collection/list.py +286 -0
- iden-0.0.1a0/src/iden/shard/comparators.py +48 -0
- iden-0.0.1a0/src/iden/shard/dict.py +324 -0
- iden-0.0.1a0/src/iden/shard/exceptions.py +13 -0
- iden-0.0.1a0/src/iden/shard/file.py +145 -0
- iden-0.0.1a0/src/iden/shard/in_memory.py +46 -0
- iden-0.0.1a0/src/iden/shard/json.py +124 -0
- iden-0.0.1a0/src/iden/shard/loader/__init__.py +31 -0
- iden-0.0.1a0/src/iden/shard/loader/base.py +131 -0
- iden-0.0.1a0/src/iden/shard/loader/dict.py +50 -0
- iden-0.0.1a0/src/iden/shard/loader/file.py +41 -0
- iden-0.0.1a0/src/iden/shard/loader/json.py +41 -0
- iden-0.0.1a0/src/iden/shard/loader/pickle.py +41 -0
- iden-0.0.1a0/src/iden/shard/loader/safetensors.py +57 -0
- iden-0.0.1a0/src/iden/shard/loader/torch.py +47 -0
- iden-0.0.1a0/src/iden/shard/loader/tuple.py +48 -0
- iden-0.0.1a0/src/iden/shard/loader/yaml.py +41 -0
- iden-0.0.1a0/src/iden/shard/loading.py +37 -0
- iden-0.0.1a0/src/iden/shard/pickle.py +124 -0
- iden-0.0.1a0/src/iden/shard/safetensors.py +144 -0
- iden-0.0.1a0/src/iden/shard/torch.py +141 -0
- iden-0.0.1a0/src/iden/shard/tuple.py +264 -0
- iden-0.0.1a0/src/iden/shard/utils.py +111 -0
- iden-0.0.1a0/src/iden/shard/yaml.py +124 -0
- iden-0.0.1a0/src/iden/testing/__init__.py +7 -0
- iden-0.0.1a0/src/iden/testing/fixtures.py +13 -0
- iden-0.0.1a0/src/iden/utils/__init__.py +1 -0
- iden-0.0.1a0/src/iden/utils/format.py +35 -0
- iden-0.0.1a0/src/iden/utils/imports.py +87 -0
- iden-0.0.1a0/src/iden/utils/path.py +39 -0
- iden-0.0.1a0/src/iden/utils/time.py +85 -0
iden-0.0.1a0/LICENSE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024, Thibaut Durand
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
iden-0.0.1a0/PKG-INFO
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: iden
|
|
3
|
+
Version: 0.0.1a0
|
|
4
|
+
Summary:
|
|
5
|
+
Home-page: https://github.com/durandtibo/iden
|
|
6
|
+
License: BSD-3-Clause
|
|
7
|
+
Keywords: dataset,shard
|
|
8
|
+
Author: Thibaut Durand
|
|
9
|
+
Author-email: durand.tibo+gh@gmail.com
|
|
10
|
+
Requires-Python: >=3.9,<3.13
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Information Technology
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
16
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
25
|
+
Provides-Extra: all
|
|
26
|
+
Requires-Dist: coola (>=0.4,<1.0)
|
|
27
|
+
Requires-Dist: numpy (>=1.22,<2.0) ; extra == "all"
|
|
28
|
+
Requires-Dist: objectory (>=0.1,<1.0)
|
|
29
|
+
Requires-Dist: safetensors (>=0.4,<1.0) ; extra == "all"
|
|
30
|
+
Requires-Dist: torch (>=1.11,<3.0) ; extra == "all"
|
|
31
|
+
Project-URL: Repository, https://github.com/durandtibo/iden
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# iden
|
|
35
|
+
|
|
36
|
+
<p align="center">
|
|
37
|
+
<a href="https://github.com/durandtibo/iden/actions">
|
|
38
|
+
<img alt="CI" src="https://github.com/durandtibo/iden/workflows/CI/badge.svg">
|
|
39
|
+
</a>
|
|
40
|
+
<a href="https://durandtibo.github.io/iden/">
|
|
41
|
+
<img alt="Documentation" src="https://github.com/durandtibo/iden/workflows/Documentation%20(stable)/badge.svg">
|
|
42
|
+
</a>
|
|
43
|
+
<a href="https://github.com/durandtibo/iden/actions">
|
|
44
|
+
<img alt="Nightly Tests" src="https://github.com/durandtibo/iden/workflows/Nightly%20Tests/badge.svg">
|
|
45
|
+
</a>
|
|
46
|
+
<a href="https://github.com/durandtibo/iden/actions">
|
|
47
|
+
<img alt="Nightly Package Tests" src="https://github.com/durandtibo/iden/workflows/Nightly%20Package%20Tests/badge.svg">
|
|
48
|
+
</a>
|
|
49
|
+
<br/>
|
|
50
|
+
<a href="https://codecov.io/gh/durandtibo/iden">
|
|
51
|
+
<img alt="Codecov" src="https://codecov.io/gh/durandtibo/iden/branch/main/graph/badge.svg">
|
|
52
|
+
</a>
|
|
53
|
+
<a href="https://codeclimate.com/github/durandtibo/iden/maintainability">
|
|
54
|
+
<img src="https://api.codeclimate.com/v1/badges/e1d6a491463b53dde654/maintainability" />
|
|
55
|
+
</a>
|
|
56
|
+
<a href="https://codeclimate.com/github/durandtibo/iden/test_coverage">
|
|
57
|
+
<img src="https://api.codeclimate.com/v1/badges/e1d6a491463b53dde654/test_coverage" />
|
|
58
|
+
</a>
|
|
59
|
+
<br/>
|
|
60
|
+
<a href="https://github.com/psf/black">
|
|
61
|
+
<img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg">
|
|
62
|
+
</a>
|
|
63
|
+
<a href="https://google.github.io/styleguide/pyguide.html#s3.8-comments-and-docstrings">
|
|
64
|
+
<img alt="Doc style: google" src="https://img.shields.io/badge/%20style-google-3666d6.svg">
|
|
65
|
+
</a>
|
|
66
|
+
<a href="https://github.com/astral-sh/ruff">
|
|
67
|
+
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff" style="max-width:100%;">
|
|
68
|
+
</a>
|
|
69
|
+
<a href="https://github.com/guilatrova/tryceratops">
|
|
70
|
+
<img alt="Doc style: google" src="https://img.shields.io/badge/try%2Fexcept%20style-tryceratops%20%F0%9F%A6%96%E2%9C%A8-black">
|
|
71
|
+
</a>
|
|
72
|
+
<br/>
|
|
73
|
+
<a href="https://pypi.org/project/iden/">
|
|
74
|
+
<img alt="PYPI version" src="https://img.shields.io/pypi/v/iden">
|
|
75
|
+
</a>
|
|
76
|
+
<a href="https://pypi.org/project/iden/">
|
|
77
|
+
<img alt="Python" src="https://img.shields.io/pypi/pyversions/iden.svg">
|
|
78
|
+
</a>
|
|
79
|
+
<a href="https://opensource.org/licenses/BSD-3-Clause">
|
|
80
|
+
<img alt="BSD-3-Clause" src="https://img.shields.io/pypi/l/iden">
|
|
81
|
+
</a>
|
|
82
|
+
<br/>
|
|
83
|
+
<a href="https://pepy.tech/project/iden">
|
|
84
|
+
<img alt="Downloads" src="https://static.pepy.tech/badge/iden">
|
|
85
|
+
</a>
|
|
86
|
+
<a href="https://pepy.tech/project/iden">
|
|
87
|
+
<img alt="Monthly downloads" src="https://static.pepy.tech/badge/iden/month">
|
|
88
|
+
</a>
|
|
89
|
+
<br/>
|
|
90
|
+
</p>
|
|
91
|
+
|
|
92
|
+
## Overview
|
|
93
|
+
|
|
94
|
+
`iden` is a simple Python library to manage a dataset of shards when training a machine learning
|
|
95
|
+
model.
|
|
96
|
+
`iden` uses a lazy loading approach to load the shard's data, so it is easy to manage shards without
|
|
97
|
+
loading their data.
|
|
98
|
+
`iden` supports different format to store shards on disk.
|
|
99
|
+
|
|
100
|
+
## Installation
|
|
101
|
+
|
|
102
|
+
We highly recommend installing
|
|
103
|
+
a [virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/).
|
|
104
|
+
`iden` can be installed from pip using the following command:
|
|
105
|
+
|
|
106
|
+
```shell
|
|
107
|
+
pip install iden
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
To make the package as slim as possible, only the minimal packages required to use `iden` are
|
|
111
|
+
installed.
|
|
112
|
+
To include all the dependencies, you can use the following command:
|
|
113
|
+
|
|
114
|
+
```shell
|
|
115
|
+
pip install iden[all]
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Please check the [get started page](https://durandtibo.github.io/iden/get_started) to see how to
|
|
119
|
+
install only some specific dependencies or other alternatives to install the library.
|
|
120
|
+
The following is the corresponding `iden` versions and tested dependencies.
|
|
121
|
+
|
|
122
|
+
## Contributing
|
|
123
|
+
|
|
124
|
+
Please check the instructions in [CONTRIBUTING.md](.github/CONTRIBUTING.md).
|
|
125
|
+
|
|
126
|
+
## Suggestions and Communication
|
|
127
|
+
|
|
128
|
+
Everyone is welcome to contribute to the community.
|
|
129
|
+
If you have any questions or suggestions, you can
|
|
130
|
+
submit [Github Issues](https://github.com/durandtibo/iden/issues).
|
|
131
|
+
We will reply to you as soon as possible. Thank you very much.
|
|
132
|
+
|
|
133
|
+
## API stability
|
|
134
|
+
|
|
135
|
+
:warning: While `iden` is in development stage, no API is guaranteed to be stable from one
|
|
136
|
+
release to the next.
|
|
137
|
+
In fact, it is very likely that the API will change multiple times before a stable 1.0.0 release.
|
|
138
|
+
In practice, this means that upgrading `iden` to a new version will possibly break any code that
|
|
139
|
+
was using the old version of `iden`.
|
|
140
|
+
|
|
141
|
+
## License
|
|
142
|
+
|
|
143
|
+
`iden` is licensed under BSD 3-Clause "New" or "Revised" license available in [LICENSE](LICENSE)
|
|
144
|
+
file.
|
|
145
|
+
|
iden-0.0.1a0/README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# iden
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://github.com/durandtibo/iden/actions">
|
|
5
|
+
<img alt="CI" src="https://github.com/durandtibo/iden/workflows/CI/badge.svg">
|
|
6
|
+
</a>
|
|
7
|
+
<a href="https://durandtibo.github.io/iden/">
|
|
8
|
+
<img alt="Documentation" src="https://github.com/durandtibo/iden/workflows/Documentation%20(stable)/badge.svg">
|
|
9
|
+
</a>
|
|
10
|
+
<a href="https://github.com/durandtibo/iden/actions">
|
|
11
|
+
<img alt="Nightly Tests" src="https://github.com/durandtibo/iden/workflows/Nightly%20Tests/badge.svg">
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://github.com/durandtibo/iden/actions">
|
|
14
|
+
<img alt="Nightly Package Tests" src="https://github.com/durandtibo/iden/workflows/Nightly%20Package%20Tests/badge.svg">
|
|
15
|
+
</a>
|
|
16
|
+
<br/>
|
|
17
|
+
<a href="https://codecov.io/gh/durandtibo/iden">
|
|
18
|
+
<img alt="Codecov" src="https://codecov.io/gh/durandtibo/iden/branch/main/graph/badge.svg">
|
|
19
|
+
</a>
|
|
20
|
+
<a href="https://codeclimate.com/github/durandtibo/iden/maintainability">
|
|
21
|
+
<img src="https://api.codeclimate.com/v1/badges/e1d6a491463b53dde654/maintainability" />
|
|
22
|
+
</a>
|
|
23
|
+
<a href="https://codeclimate.com/github/durandtibo/iden/test_coverage">
|
|
24
|
+
<img src="https://api.codeclimate.com/v1/badges/e1d6a491463b53dde654/test_coverage" />
|
|
25
|
+
</a>
|
|
26
|
+
<br/>
|
|
27
|
+
<a href="https://github.com/psf/black">
|
|
28
|
+
<img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg">
|
|
29
|
+
</a>
|
|
30
|
+
<a href="https://google.github.io/styleguide/pyguide.html#s3.8-comments-and-docstrings">
|
|
31
|
+
<img alt="Doc style: google" src="https://img.shields.io/badge/%20style-google-3666d6.svg">
|
|
32
|
+
</a>
|
|
33
|
+
<a href="https://github.com/astral-sh/ruff">
|
|
34
|
+
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff" style="max-width:100%;">
|
|
35
|
+
</a>
|
|
36
|
+
<a href="https://github.com/guilatrova/tryceratops">
|
|
37
|
+
<img alt="Doc style: google" src="https://img.shields.io/badge/try%2Fexcept%20style-tryceratops%20%F0%9F%A6%96%E2%9C%A8-black">
|
|
38
|
+
</a>
|
|
39
|
+
<br/>
|
|
40
|
+
<a href="https://pypi.org/project/iden/">
|
|
41
|
+
<img alt="PYPI version" src="https://img.shields.io/pypi/v/iden">
|
|
42
|
+
</a>
|
|
43
|
+
<a href="https://pypi.org/project/iden/">
|
|
44
|
+
<img alt="Python" src="https://img.shields.io/pypi/pyversions/iden.svg">
|
|
45
|
+
</a>
|
|
46
|
+
<a href="https://opensource.org/licenses/BSD-3-Clause">
|
|
47
|
+
<img alt="BSD-3-Clause" src="https://img.shields.io/pypi/l/iden">
|
|
48
|
+
</a>
|
|
49
|
+
<br/>
|
|
50
|
+
<a href="https://pepy.tech/project/iden">
|
|
51
|
+
<img alt="Downloads" src="https://static.pepy.tech/badge/iden">
|
|
52
|
+
</a>
|
|
53
|
+
<a href="https://pepy.tech/project/iden">
|
|
54
|
+
<img alt="Monthly downloads" src="https://static.pepy.tech/badge/iden/month">
|
|
55
|
+
</a>
|
|
56
|
+
<br/>
|
|
57
|
+
</p>
|
|
58
|
+
|
|
59
|
+
## Overview
|
|
60
|
+
|
|
61
|
+
`iden` is a simple Python library to manage a dataset of shards when training a machine learning
|
|
62
|
+
model.
|
|
63
|
+
`iden` uses a lazy loading approach to load the shard's data, so it is easy to manage shards without
|
|
64
|
+
loading their data.
|
|
65
|
+
`iden` supports different format to store shards on disk.
|
|
66
|
+
|
|
67
|
+
## Installation
|
|
68
|
+
|
|
69
|
+
We highly recommend installing
|
|
70
|
+
a [virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/).
|
|
71
|
+
`iden` can be installed from pip using the following command:
|
|
72
|
+
|
|
73
|
+
```shell
|
|
74
|
+
pip install iden
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
To make the package as slim as possible, only the minimal packages required to use `iden` are
|
|
78
|
+
installed.
|
|
79
|
+
To include all the dependencies, you can use the following command:
|
|
80
|
+
|
|
81
|
+
```shell
|
|
82
|
+
pip install iden[all]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Please check the [get started page](https://durandtibo.github.io/iden/get_started) to see how to
|
|
86
|
+
install only some specific dependencies or other alternatives to install the library.
|
|
87
|
+
The following is the corresponding `iden` versions and tested dependencies.
|
|
88
|
+
|
|
89
|
+
## Contributing
|
|
90
|
+
|
|
91
|
+
Please check the instructions in [CONTRIBUTING.md](.github/CONTRIBUTING.md).
|
|
92
|
+
|
|
93
|
+
## Suggestions and Communication
|
|
94
|
+
|
|
95
|
+
Everyone is welcome to contribute to the community.
|
|
96
|
+
If you have any questions or suggestions, you can
|
|
97
|
+
submit [Github Issues](https://github.com/durandtibo/iden/issues).
|
|
98
|
+
We will reply to you as soon as possible. Thank you very much.
|
|
99
|
+
|
|
100
|
+
## API stability
|
|
101
|
+
|
|
102
|
+
:warning: While `iden` is in development stage, no API is guaranteed to be stable from one
|
|
103
|
+
release to the next.
|
|
104
|
+
In fact, it is very likely that the API will change multiple times before a stable 1.0.0 release.
|
|
105
|
+
In practice, this means that upgrading `iden` to a new version will possibly break any code that
|
|
106
|
+
was using the old version of `iden`.
|
|
107
|
+
|
|
108
|
+
## License
|
|
109
|
+
|
|
110
|
+
`iden` is licensed under BSD 3-Clause "New" or "Revised" license available in [LICENSE](LICENSE)
|
|
111
|
+
file.
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "iden"
|
|
3
|
+
version = "0.0.1a0"
|
|
4
|
+
description = ""
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = ["Thibaut Durand <durand.tibo+gh@gmail.com>"]
|
|
7
|
+
homepage = "https://github.com/durandtibo/iden"
|
|
8
|
+
repository = "https://github.com/durandtibo/iden"
|
|
9
|
+
keywords = ["dataset", "shard"]
|
|
10
|
+
license = "BSD-3-Clause"
|
|
11
|
+
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 4 - Beta",
|
|
14
|
+
"Intended Audience :: Developers",
|
|
15
|
+
"Intended Audience :: Information Technology",
|
|
16
|
+
"Intended Audience :: Science/Research",
|
|
17
|
+
"License :: OSI Approved :: BSD License",
|
|
18
|
+
"Operating System :: POSIX :: Linux",
|
|
19
|
+
"Programming Language :: Python :: 3.9",
|
|
20
|
+
"Programming Language :: Python :: 3.10",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Topic :: Scientific/Engineering",
|
|
24
|
+
"Topic :: Software Development :: Libraries",
|
|
25
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
packages = [
|
|
29
|
+
{ include = "iden", from = "src" },
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[tool.poetry.dependencies]
|
|
33
|
+
# Core dependencies
|
|
34
|
+
coola = ">=0.4,<1.0"
|
|
35
|
+
objectory = ">=0.1,<1.0"
|
|
36
|
+
python = ">=3.9,<3.13"
|
|
37
|
+
|
|
38
|
+
# Optional dependencies
|
|
39
|
+
numpy = ">=1.22,<2.0"
|
|
40
|
+
safetensors = { version = ">=0.4,<1.0", optional = true }
|
|
41
|
+
torch = { version = ">=1.11,<3.0", optional = true }
|
|
42
|
+
|
|
43
|
+
[tool.poetry.extras]
|
|
44
|
+
all = ["numpy", "safetensors", "torch"]
|
|
45
|
+
|
|
46
|
+
[tool.poetry.group.docs]
|
|
47
|
+
optional = true
|
|
48
|
+
|
|
49
|
+
[tool.poetry.group.docs.dependencies]
|
|
50
|
+
mike = "^2.0"
|
|
51
|
+
mkdocs-material = "^9.5"
|
|
52
|
+
mkdocstrings = { extras = ["python"], version = "^0.24" }
|
|
53
|
+
|
|
54
|
+
[tool.poetry.group.dev.dependencies]
|
|
55
|
+
black = ">=24.1"
|
|
56
|
+
coverage = { extras = ["toml"], version = "^7.4" }
|
|
57
|
+
docformatter = { extras = ["tomli"], version = "^1.7" }
|
|
58
|
+
pre-commit = "^3.6"
|
|
59
|
+
pygments = "^2.17"
|
|
60
|
+
pytest = "^8.0"
|
|
61
|
+
pytest-cov = "^4.1"
|
|
62
|
+
pytest-timeout = "^2.2"
|
|
63
|
+
ruff = ">=0.3.0,<1.0"
|
|
64
|
+
xdoctest = "^1.1"
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
[build-system]
|
|
68
|
+
requires = ["poetry-core>=1.0.0"]
|
|
69
|
+
build-backend = "poetry.core.masonry.api"
|
|
70
|
+
|
|
71
|
+
[tool.coverage.paths]
|
|
72
|
+
source = ["src", "*/site-packages"]
|
|
73
|
+
|
|
74
|
+
[tool.coverage.run]
|
|
75
|
+
branch = true
|
|
76
|
+
source = ["iden"]
|
|
77
|
+
|
|
78
|
+
[tool.coverage.report]
|
|
79
|
+
show_missing = true
|
|
80
|
+
exclude_lines = [
|
|
81
|
+
"pragma: no cover",
|
|
82
|
+
"if TYPE_CHECKING:"
|
|
83
|
+
]
|
|
84
|
+
|
|
85
|
+
[tool.pytest.ini_options]
|
|
86
|
+
testpaths = "tests/"
|
|
87
|
+
log_format = "%(asctime)s - %(levelname)s - %(name)s - %(message)s"
|
|
88
|
+
log_level = "DEBUG"
|
|
89
|
+
addopts = "--color yes --durations 10 -rf"
|
|
90
|
+
# Configuration of the short test summary info
|
|
91
|
+
# https://docs.pytest.org/en/stable/usage.html#detailed-summary-report
|
|
92
|
+
|
|
93
|
+
[tool.black]
|
|
94
|
+
line-length = 100
|
|
95
|
+
target-version = ["py39", "py310", "py311", "py312"]
|
|
96
|
+
include = '\.pyi?$'
|
|
97
|
+
|
|
98
|
+
[tool.pylint.FORMAT]
|
|
99
|
+
max-line-length = 100
|
|
100
|
+
|
|
101
|
+
[tool.isort]
|
|
102
|
+
profile = "black"
|
|
103
|
+
|
|
104
|
+
[tool.docformatter]
|
|
105
|
+
recursive = true
|
|
106
|
+
wrap-summaries = 72
|
|
107
|
+
wrap-descriptions = 72
|
|
108
|
+
syntax = "google"
|
|
109
|
+
|
|
110
|
+
[tool.ruff]
|
|
111
|
+
# List of rules: https://docs.astral.sh/ruff/rules/
|
|
112
|
+
lint.select = [
|
|
113
|
+
"A", # builtins
|
|
114
|
+
"ANN", # annotations
|
|
115
|
+
"ARG", # flake8-unused-arguments
|
|
116
|
+
"B", # bugbear
|
|
117
|
+
"BLE", # flake8-blind-except
|
|
118
|
+
"C4", # flake8-comprehensions
|
|
119
|
+
"D", # pydocstyle
|
|
120
|
+
"E", # pycodestyle (Error)
|
|
121
|
+
"EM", # flake8-errmsg
|
|
122
|
+
"F", # pyflakes
|
|
123
|
+
"FA", # flake8-future-annotations
|
|
124
|
+
"FURB", # refurb
|
|
125
|
+
"ICN", # flake8-import-conventions
|
|
126
|
+
"INP", # flake8-no-pep420
|
|
127
|
+
"ISC", # flake8-implicit-str-concat
|
|
128
|
+
"LOG", # logging
|
|
129
|
+
"N", # naming
|
|
130
|
+
"PD", # pandas-vet
|
|
131
|
+
"PERF", # Perflint
|
|
132
|
+
"PGH", # pygrep-hooks
|
|
133
|
+
"PIE", # flake8-pie
|
|
134
|
+
"PL", # Pylint
|
|
135
|
+
"PT", # flake8-pytest-style
|
|
136
|
+
"PTH", # pathlib
|
|
137
|
+
"PYI", # flake8-pyi
|
|
138
|
+
"Q", # flake8-quotes
|
|
139
|
+
"RET", # flake8-return
|
|
140
|
+
"RSE", # flake8-raise
|
|
141
|
+
"S", # flake8-bandit
|
|
142
|
+
"SIM", # flake8-simplify
|
|
143
|
+
"T20", # flake8-print
|
|
144
|
+
"TCH", # flake8-type-checking
|
|
145
|
+
"TD", # flake8-todos
|
|
146
|
+
"TID", # flake8-tidy-imports
|
|
147
|
+
"TRY", # tryceratops
|
|
148
|
+
"UP", # pyupgrade
|
|
149
|
+
"W", # pycodestyle (Warning)
|
|
150
|
+
]
|
|
151
|
+
lint.ignore = [
|
|
152
|
+
"A003", # Class attribute `{name}` is shadowing a python builtin
|
|
153
|
+
"ANN101", # Missing type annotation for `self` in method
|
|
154
|
+
"ANN102", # Missing type annotation for `cls` in classmethod
|
|
155
|
+
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed.
|
|
156
|
+
"B905", # `zip()` without an explicit strict= parameter set. The `strict=` argument was added in Python 3.10
|
|
157
|
+
"E501", # Line lengths are recommended to be no greater than 79 characters.
|
|
158
|
+
"W505", # Doc line too long
|
|
159
|
+
"PLR0913", # Too many arguments in function definition (8 > 5)
|
|
160
|
+
"PLR2004", # Magic value used in comparison, consider replacing 0.0 with a constant variable
|
|
161
|
+
|
|
162
|
+
# The following rules are ignored because they conflict with another library like docformatter.
|
|
163
|
+
"D102", # Missing docstring in public method
|
|
164
|
+
"D105", # Missing docstring in magic method
|
|
165
|
+
"D107", # Missing docstring in `__init__`
|
|
166
|
+
"D205", # 1 blank line required between summary line and description
|
|
167
|
+
"D209", # Multi-line docstring closing quotes should be on a separate line
|
|
168
|
+
]
|
|
169
|
+
|
|
170
|
+
# Allow autofix for all enabled rules (when `--fix`) is provided.
|
|
171
|
+
lint.fixable = [
|
|
172
|
+
"A",
|
|
173
|
+
"ANN",
|
|
174
|
+
"ARG",
|
|
175
|
+
"B",
|
|
176
|
+
"BLE",
|
|
177
|
+
"C4",
|
|
178
|
+
"D",
|
|
179
|
+
"E",
|
|
180
|
+
"EM",
|
|
181
|
+
"F",
|
|
182
|
+
"FA",
|
|
183
|
+
"FURB",
|
|
184
|
+
"ICN",
|
|
185
|
+
"INP",
|
|
186
|
+
"ISC",
|
|
187
|
+
"LOG",
|
|
188
|
+
"PD",
|
|
189
|
+
"PERF",
|
|
190
|
+
"PGH",
|
|
191
|
+
"PIE",
|
|
192
|
+
"PL",
|
|
193
|
+
"PT",
|
|
194
|
+
"PTH",
|
|
195
|
+
"PYI",
|
|
196
|
+
"Q",
|
|
197
|
+
"RET",
|
|
198
|
+
"RSE",
|
|
199
|
+
"S",
|
|
200
|
+
"SIM",
|
|
201
|
+
"T20",
|
|
202
|
+
"TCH",
|
|
203
|
+
"TD",
|
|
204
|
+
"TID",
|
|
205
|
+
"TRY",
|
|
206
|
+
"W",
|
|
207
|
+
]
|
|
208
|
+
lint.unfixable = []
|
|
209
|
+
|
|
210
|
+
lint.exclude = [
|
|
211
|
+
".bzr",
|
|
212
|
+
".direnv",
|
|
213
|
+
".eggs",
|
|
214
|
+
".git",
|
|
215
|
+
".hg",
|
|
216
|
+
".mypy_cache",
|
|
217
|
+
".nox",
|
|
218
|
+
".pants.d",
|
|
219
|
+
".pytype",
|
|
220
|
+
".ruff_cache",
|
|
221
|
+
".tox",
|
|
222
|
+
".venv",
|
|
223
|
+
"__pypackages__",
|
|
224
|
+
"_build",
|
|
225
|
+
"buck-out",
|
|
226
|
+
"build",
|
|
227
|
+
"dist",
|
|
228
|
+
"node_modules",
|
|
229
|
+
"venv",
|
|
230
|
+
]
|
|
231
|
+
|
|
232
|
+
# Enable on top of the Google convention.
|
|
233
|
+
lint.extend-select = ["D400", "D401", "D404"]
|
|
234
|
+
|
|
235
|
+
line-length = 100
|
|
236
|
+
target-version = "py39"
|
|
237
|
+
src = ["src"]
|
|
238
|
+
|
|
239
|
+
[tool.ruff.lint.per-file-ignores]
|
|
240
|
+
# Ignore all directories named `tests`.
|
|
241
|
+
"tests/**" = [
|
|
242
|
+
"D", # pydocstyle
|
|
243
|
+
"PL", # Pylint
|
|
244
|
+
"S101", # flake8-bandit
|
|
245
|
+
]
|
|
246
|
+
|
|
247
|
+
[tool.ruff.lint.mccabe]
|
|
248
|
+
max-complexity = 10
|
|
249
|
+
|
|
250
|
+
[tool.ruff.lint.pydocstyle]
|
|
251
|
+
convention = "google"
|
|
252
|
+
|
|
253
|
+
[tool.ruff.lint.pycodestyle]
|
|
254
|
+
max-doc-length = 72
|
|
255
|
+
|
|
256
|
+
[tool.ruff.lint.isort]
|
|
257
|
+
force-sort-within-sections = true
|
|
258
|
+
combine-as-imports = true
|
|
259
|
+
known-first-party = ["src"]
|
|
260
|
+
|
|
261
|
+
[tool.ruff.lint.flake8-import-conventions]
|
|
262
|
+
[tool.ruff.lint.flake8-import-conventions.aliases]
|
|
263
|
+
numpy = "np"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
r"""Root package."""
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
r"""Contain dataset implementations."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
__all__ = ["BaseDataset", "VanillaDataset", "create_vanilla_dataset", "load_from_uri"]
|
|
6
|
+
|
|
7
|
+
from iden.dataset.base import BaseDataset
|
|
8
|
+
from iden.dataset.loading import load_from_uri
|
|
9
|
+
from iden.dataset.vanilla import VanillaDataset, create_vanilla_dataset
|