pygenutils 16.3.1__tar.gz → 16.4.0__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.
Potentially problematic release.
This version of pygenutils might be problematic. Click here for more details.
- {pygenutils-16.3.1/pygenutils.egg-info → pygenutils-16.4.0}/PKG-INFO +32 -28
- {pygenutils-16.3.1 → pygenutils-16.4.0}/README.md +25 -24
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/__init__.py +1 -1
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/arrays_and_lists/data_manipulation.py +3 -3
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/number_bases/base_converters.py +15 -14
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/strings/text_formatters.py +1 -1
- pygenutils-16.4.0/pygenutils/time_handling/_optional_climate.py +44 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/time_handling/calendar_utils.py +4 -2
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/time_handling/countdown.py +27 -14
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/time_handling/date_and_time_utils.py +38 -13
- {pygenutils-16.3.1 → pygenutils-16.4.0/pygenutils.egg-info}/PKG-INFO +32 -28
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils.egg-info/SOURCES.txt +1 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils.egg-info/requires.txt +7 -3
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pyproject.toml +8 -4
- {pygenutils-16.3.1 → pygenutils-16.4.0}/LICENSE +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/MANIFEST.in +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/arrays_and_lists/__init__.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/arrays_and_lists/conversions.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/arrays_and_lists/maths.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/arrays_and_lists/patterns.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/audio_and_video/__init__.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/audio_and_video/audio_and_video_manipulation.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/audio_and_video/merge_audio_and_video.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/audio_and_video/merge_audio_or_video.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/audio_and_video/trim_media.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/dictionaries/__init__.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/dictionaries/dict_handler.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/dictionaries/dict_operators.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/number_bases/__init__.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/number_bases/binary_operations.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/number_bases/bitwise_operators.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/number_bases/mathematical_utils.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/operative_systems/__init__.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/operative_systems/os_operations.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/sets_and_intervals/__init__.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/sets_and_intervals/interval_handler.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/sets_and_intervals/sets_handler.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/strings/__init__.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/strings/string_handler.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/time_handling/__init__.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/time_handling/date_and_time_maths.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/time_handling/program_snippet_exec_timers.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/time_handling/time_formatters.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/time_handling/time_utils.py +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils.egg-info/dependency_links.txt +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils.egg-info/top_level.txt +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/setup.cfg +0 -0
- {pygenutils-16.3.1 → pygenutils-16.4.0}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pygenutils
|
|
3
|
-
Version: 16.
|
|
3
|
+
Version: 16.4.0
|
|
4
4
|
Summary: A comprehensive Python utility library for general-purpose and specialised tasks
|
|
5
5
|
Author-email: Jon Ander Gabantxo <jagabantxo@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -43,10 +43,12 @@ Requires-Python: >=3.10
|
|
|
43
43
|
Description-Content-Type: text/markdown
|
|
44
44
|
License-File: LICENSE
|
|
45
45
|
Requires-Dist: more_itertools>=10.0.0
|
|
46
|
-
Requires-Dist: numpy
|
|
47
|
-
Requires-Dist: pandas
|
|
48
|
-
Requires-Dist: filewise>=3.
|
|
46
|
+
Requires-Dist: numpy>=2.2.3
|
|
47
|
+
Requires-Dist: pandas>=2.2.3
|
|
48
|
+
Requires-Dist: filewise>=3.13.0
|
|
49
49
|
Requires-Dist: paramlib>=3.4.10
|
|
50
|
+
Provides-Extra: climate
|
|
51
|
+
Requires-Dist: climarraykit>=0.1.0; extra == "climate"
|
|
50
52
|
Provides-Extra: xarray
|
|
51
53
|
Requires-Dist: xarray>=2024.2.0; extra == "xarray"
|
|
52
54
|
Provides-Extra: arrow
|
|
@@ -58,6 +60,7 @@ Requires-Dist: black>=23.0.0; extra == "dev"
|
|
|
58
60
|
Requires-Dist: isort>=5.0.0; extra == "dev"
|
|
59
61
|
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
60
62
|
Requires-Dist: flake8>=6.0.0; extra == "dev"
|
|
63
|
+
Requires-Dist: climarraykit>=0.1.0; extra == "dev"
|
|
61
64
|
Dynamic: license-file
|
|
62
65
|
|
|
63
66
|
# pygenutils
|
|
@@ -119,15 +122,18 @@ This package has minimal external dependencies and is designed to be lightweight
|
|
|
119
122
|
|
|
120
123
|
```bash
|
|
121
124
|
pip install pygenutils # Core functionality
|
|
122
|
-
pip install pygenutils[
|
|
125
|
+
pip install 'pygenutils[climate]' # NetCDF / climarraykit features in time_handling
|
|
126
|
+
pip install pygenutils[arrow] # Arrow support (optional)
|
|
123
127
|
```
|
|
124
128
|
|
|
125
|
-
|
|
129
|
+
Core install pulls **numpy**, **pandas**, **filewise**, **paramlib**, and **more_itertools**. **climarraykit** (and thus **xarray** for those code paths) is optional.
|
|
126
130
|
|
|
127
|
-
**
|
|
131
|
+
**Optional extras**:
|
|
128
132
|
|
|
129
|
-
- `pip install pygenutils`
|
|
130
|
-
- `pip install pygenutils[
|
|
133
|
+
- `pip install pygenutils` — core only (no climarraykit)
|
|
134
|
+
- `pip install 'pygenutils[climate]'` — NetCDF helpers (`ncfile_integrity_status`, `get_file_dimensions` proxies)
|
|
135
|
+
- `pip install pygenutils[arrow]` — Arrow for enhanced time handling
|
|
136
|
+
- `pip install pygenutils[xarray]` — xarray only (rare; prefer `[climate]` for climarraykit-backed APIs)
|
|
131
137
|
|
|
132
138
|
### Package Updates
|
|
133
139
|
|
|
@@ -154,7 +160,7 @@ cd pygenutils
|
|
|
154
160
|
pip install -e .[dev]
|
|
155
161
|
```
|
|
156
162
|
|
|
157
|
-
**Note**: The `-e` flag installs the package in "editable" mode
|
|
163
|
+
**Note**: The `-e` flag installs the package in "editable" mode. The `[dev]` extra includes development tools **and** `climarraykit` so time-handling tests and NetCDF code paths work without a separate `[climate]` install.
|
|
158
164
|
|
|
159
165
|
#### Alternative Setup (Explicit Git Dependencies)
|
|
160
166
|
|
|
@@ -168,11 +174,11 @@ cd pygenutils
|
|
|
168
174
|
# Install development dependencies from requirements-dev.txt
|
|
169
175
|
pip install -r requirements-dev.txt
|
|
170
176
|
|
|
171
|
-
# Install in editable mode
|
|
172
|
-
pip install -e .
|
|
177
|
+
# Install in editable mode (add [climate] if you skip Git climarraykit and need NetCDF features)
|
|
178
|
+
pip install -e .[dev]
|
|
173
179
|
```
|
|
174
180
|
|
|
175
|
-
This approach gives you
|
|
181
|
+
This approach gives you Git checkouts of **filewise**, **climarraykit**, and **paramlib** plus pinned scientific stack; use **`pip install -e .[dev]`** so editable **pygenutils** matches **`pyproject.toml`** (including dev + climarraykit).
|
|
176
182
|
|
|
177
183
|
#### Development with Optional Dependencies
|
|
178
184
|
|
|
@@ -183,7 +189,8 @@ For full development capabilities, including testing and linting:
|
|
|
183
189
|
pip install -e ".[dev]"
|
|
184
190
|
|
|
185
191
|
# Or install specific optional dependencies
|
|
186
|
-
pip install -e ".[
|
|
192
|
+
pip install -e ".[climate]" # climarraykit / NetCDF-related time_handling
|
|
193
|
+
pip install -e ".[xarray]" # xarray only (optional; [climate] is usually preferred)
|
|
187
194
|
```
|
|
188
195
|
|
|
189
196
|
### For Multiple Package Development
|
|
@@ -194,20 +201,22 @@ If you're working on multiple interdependent packages simultaneously:
|
|
|
194
201
|
# Clone all repositories
|
|
195
202
|
git clone https://github.com/EusDancerDev/pygenutils.git
|
|
196
203
|
git clone https://github.com/EusDancerDev/filewise.git
|
|
204
|
+
git clone https://github.com/EusDancerDev/climarraykit.git
|
|
197
205
|
git clone https://github.com/EusDancerDev/paramlib.git
|
|
198
206
|
|
|
199
|
-
# Install each in editable mode
|
|
207
|
+
# Install each in editable mode (order: dependencies first)
|
|
200
208
|
pip install -e ./filewise
|
|
201
209
|
pip install -e ./paramlib
|
|
202
|
-
pip install -e ./
|
|
210
|
+
pip install -e ./climarraykit
|
|
211
|
+
pip install -e ./pygenutils[dev]
|
|
203
212
|
```
|
|
204
213
|
|
|
205
214
|
### Troubleshooting
|
|
206
215
|
|
|
207
216
|
If you encounter import errors after cloning:
|
|
208
217
|
|
|
209
|
-
1. **For regular users**: Run `pip install pygenutils` (
|
|
210
|
-
2. **For developers**: Run `pip install -e .[dev]`
|
|
218
|
+
1. **For regular users**: Run `pip install pygenutils` (core dependencies) or `pip install 'pygenutils[climate]'` for NetCDF/climarraykit features
|
|
219
|
+
2. **For developers**: Run `pip install -e .[dev]` (includes dev tools and climarraykit)
|
|
211
220
|
3. **Verify Python environment**: Make sure you're using a compatible Python version (3.10+)
|
|
212
221
|
|
|
213
222
|
### Verify Installation
|
|
@@ -227,21 +236,16 @@ try:
|
|
|
227
236
|
|
|
228
237
|
except ImportError as e:
|
|
229
238
|
print(f"❌ Import error: {e}")
|
|
230
|
-
print("💡 For regular users: pip install pygenutils")
|
|
239
|
+
print("💡 For regular users: pip install pygenutils # add [climate] for NetCDF features")
|
|
231
240
|
print("💡 For developers: pip install -e .[dev]")
|
|
232
241
|
```
|
|
233
242
|
|
|
234
243
|
### Implementation Notes
|
|
235
244
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
- **
|
|
239
|
-
- **
|
|
240
|
-
- **Installation Methods**:
|
|
241
|
-
- **Regular users**: Simple `pip install pygenutils` with all dependencies included
|
|
242
|
-
- **Developers**: `pip install -e .[dev]` for latest Git versions and development tools
|
|
243
|
-
- **PyPI Compatibility**: All packages can be published without Git dependency issues
|
|
244
|
-
- **Development Flexibility**: Contributors get access to latest versions for testing and development
|
|
245
|
+
- **Core PyPI dependencies**: **more_itertools**, **numpy**, **pandas**, **filewise**, **paramlib**.
|
|
246
|
+
- **Optional `[climate]`**: **climarraykit** (pulls **xarray**) for NetCDF-related helpers in `time_handling`.
|
|
247
|
+
- **Optional `[dev]`**: development tools plus **climarraykit** for a full local test stack.
|
|
248
|
+
- **Git-based `requirements-dev.txt`**: optional bleeding-edge **filewise**, **climarraykit**, **paramlib** before `pip install -e .[dev]`.
|
|
245
249
|
|
|
246
250
|
### Package Structure
|
|
247
251
|
|
|
@@ -57,15 +57,18 @@ This package has minimal external dependencies and is designed to be lightweight
|
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
59
|
pip install pygenutils # Core functionality
|
|
60
|
-
pip install pygenutils[
|
|
60
|
+
pip install 'pygenutils[climate]' # NetCDF / climarraykit features in time_handling
|
|
61
|
+
pip install pygenutils[arrow] # Arrow support (optional)
|
|
61
62
|
```
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
Core install pulls **numpy**, **pandas**, **filewise**, **paramlib**, and **more_itertools**. **climarraykit** (and thus **xarray** for those code paths) is optional.
|
|
64
65
|
|
|
65
|
-
**
|
|
66
|
+
**Optional extras**:
|
|
66
67
|
|
|
67
|
-
- `pip install pygenutils`
|
|
68
|
-
- `pip install pygenutils[
|
|
68
|
+
- `pip install pygenutils` — core only (no climarraykit)
|
|
69
|
+
- `pip install 'pygenutils[climate]'` — NetCDF helpers (`ncfile_integrity_status`, `get_file_dimensions` proxies)
|
|
70
|
+
- `pip install pygenutils[arrow]` — Arrow for enhanced time handling
|
|
71
|
+
- `pip install pygenutils[xarray]` — xarray only (rare; prefer `[climate]` for climarraykit-backed APIs)
|
|
69
72
|
|
|
70
73
|
### Package Updates
|
|
71
74
|
|
|
@@ -92,7 +95,7 @@ cd pygenutils
|
|
|
92
95
|
pip install -e .[dev]
|
|
93
96
|
```
|
|
94
97
|
|
|
95
|
-
**Note**: The `-e` flag installs the package in "editable" mode
|
|
98
|
+
**Note**: The `-e` flag installs the package in "editable" mode. The `[dev]` extra includes development tools **and** `climarraykit` so time-handling tests and NetCDF code paths work without a separate `[climate]` install.
|
|
96
99
|
|
|
97
100
|
#### Alternative Setup (Explicit Git Dependencies)
|
|
98
101
|
|
|
@@ -106,11 +109,11 @@ cd pygenutils
|
|
|
106
109
|
# Install development dependencies from requirements-dev.txt
|
|
107
110
|
pip install -r requirements-dev.txt
|
|
108
111
|
|
|
109
|
-
# Install in editable mode
|
|
110
|
-
pip install -e .
|
|
112
|
+
# Install in editable mode (add [climate] if you skip Git climarraykit and need NetCDF features)
|
|
113
|
+
pip install -e .[dev]
|
|
111
114
|
```
|
|
112
115
|
|
|
113
|
-
This approach gives you
|
|
116
|
+
This approach gives you Git checkouts of **filewise**, **climarraykit**, and **paramlib** plus pinned scientific stack; use **`pip install -e .[dev]`** so editable **pygenutils** matches **`pyproject.toml`** (including dev + climarraykit).
|
|
114
117
|
|
|
115
118
|
#### Development with Optional Dependencies
|
|
116
119
|
|
|
@@ -121,7 +124,8 @@ For full development capabilities, including testing and linting:
|
|
|
121
124
|
pip install -e ".[dev]"
|
|
122
125
|
|
|
123
126
|
# Or install specific optional dependencies
|
|
124
|
-
pip install -e ".[
|
|
127
|
+
pip install -e ".[climate]" # climarraykit / NetCDF-related time_handling
|
|
128
|
+
pip install -e ".[xarray]" # xarray only (optional; [climate] is usually preferred)
|
|
125
129
|
```
|
|
126
130
|
|
|
127
131
|
### For Multiple Package Development
|
|
@@ -132,20 +136,22 @@ If you're working on multiple interdependent packages simultaneously:
|
|
|
132
136
|
# Clone all repositories
|
|
133
137
|
git clone https://github.com/EusDancerDev/pygenutils.git
|
|
134
138
|
git clone https://github.com/EusDancerDev/filewise.git
|
|
139
|
+
git clone https://github.com/EusDancerDev/climarraykit.git
|
|
135
140
|
git clone https://github.com/EusDancerDev/paramlib.git
|
|
136
141
|
|
|
137
|
-
# Install each in editable mode
|
|
142
|
+
# Install each in editable mode (order: dependencies first)
|
|
138
143
|
pip install -e ./filewise
|
|
139
144
|
pip install -e ./paramlib
|
|
140
|
-
pip install -e ./
|
|
145
|
+
pip install -e ./climarraykit
|
|
146
|
+
pip install -e ./pygenutils[dev]
|
|
141
147
|
```
|
|
142
148
|
|
|
143
149
|
### Troubleshooting
|
|
144
150
|
|
|
145
151
|
If you encounter import errors after cloning:
|
|
146
152
|
|
|
147
|
-
1. **For regular users**: Run `pip install pygenutils` (
|
|
148
|
-
2. **For developers**: Run `pip install -e .[dev]`
|
|
153
|
+
1. **For regular users**: Run `pip install pygenutils` (core dependencies) or `pip install 'pygenutils[climate]'` for NetCDF/climarraykit features
|
|
154
|
+
2. **For developers**: Run `pip install -e .[dev]` (includes dev tools and climarraykit)
|
|
149
155
|
3. **Verify Python environment**: Make sure you're using a compatible Python version (3.10+)
|
|
150
156
|
|
|
151
157
|
### Verify Installation
|
|
@@ -165,21 +171,16 @@ try:
|
|
|
165
171
|
|
|
166
172
|
except ImportError as e:
|
|
167
173
|
print(f"❌ Import error: {e}")
|
|
168
|
-
print("💡 For regular users: pip install pygenutils")
|
|
174
|
+
print("💡 For regular users: pip install pygenutils # add [climate] for NetCDF features")
|
|
169
175
|
print("💡 For developers: pip install -e .[dev]")
|
|
170
176
|
```
|
|
171
177
|
|
|
172
178
|
### Implementation Notes
|
|
173
179
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
- **
|
|
177
|
-
- **
|
|
178
|
-
- **Installation Methods**:
|
|
179
|
-
- **Regular users**: Simple `pip install pygenutils` with all dependencies included
|
|
180
|
-
- **Developers**: `pip install -e .[dev]` for latest Git versions and development tools
|
|
181
|
-
- **PyPI Compatibility**: All packages can be published without Git dependency issues
|
|
182
|
-
- **Development Flexibility**: Contributors get access to latest versions for testing and development
|
|
180
|
+
- **Core PyPI dependencies**: **more_itertools**, **numpy**, **pandas**, **filewise**, **paramlib**.
|
|
181
|
+
- **Optional `[climate]`**: **climarraykit** (pulls **xarray**) for NetCDF-related helpers in `time_handling`.
|
|
182
|
+
- **Optional `[dev]`**: development tools plus **climarraykit** for a full local test stack.
|
|
183
|
+
- **Git-based `requirements-dev.txt`**: optional bleeding-edge **filewise**, **climarraykit**, **paramlib** before `pip install -e .[dev]`.
|
|
183
184
|
|
|
184
185
|
### Package Structure
|
|
185
186
|
|
|
@@ -535,10 +535,10 @@ def flatten_list(lst, return_list=True, sort=False, reverse=False):
|
|
|
535
535
|
[1, 2, 3, 4, 5, 6]
|
|
536
536
|
"""
|
|
537
537
|
if return_list:
|
|
538
|
-
|
|
538
|
+
flattened_list = list(_flatten_generator(lst))
|
|
539
539
|
if sort:
|
|
540
|
-
return sort_1d_basic(
|
|
541
|
-
return
|
|
540
|
+
return sort_1d_basic(flattened_list, reverse=reverse)
|
|
541
|
+
return flattened_list
|
|
542
542
|
else:
|
|
543
543
|
return _flatten_generator(lst)
|
|
544
544
|
|
|
@@ -59,8 +59,8 @@ def _check_input_binary(b):
|
|
|
59
59
|
str
|
|
60
60
|
The binary number as a string without the 'b' or '0b' prefix.
|
|
61
61
|
"""
|
|
62
|
-
b_clean = substring_replacer(substring_replacer(b, "
|
|
63
|
-
are_only_binaries = find_substring_index(b_clean, "^[01]+$")
|
|
62
|
+
b_clean = substring_replacer(substring_replacer(b, "0b", ""), "b", "")
|
|
63
|
+
are_only_binaries = find_substring_index(b_clean, r"^[01]+$", advanced_search=True)
|
|
64
64
|
if are_only_binaries == -1:
|
|
65
65
|
raise ValueError("The input binary number is not in the correct format.")
|
|
66
66
|
return b_clean
|
|
@@ -130,12 +130,12 @@ def dec2bin_basic(n):
|
|
|
130
130
|
The binary representation of the input number.
|
|
131
131
|
"""
|
|
132
132
|
n_checked = _check_input_int(n)
|
|
133
|
-
|
|
133
|
+
bits_lsb_first = "" # LSB == Least Significant Bit
|
|
134
134
|
while n_checked >= 1:
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
mod = n_checked % 2
|
|
136
|
+
bits_lsb_first += str(mod)
|
|
137
137
|
n_checked //= 2
|
|
138
|
-
return
|
|
138
|
+
return bits_lsb_first[::-1]
|
|
139
139
|
|
|
140
140
|
# Advanced #
|
|
141
141
|
#-#-#-#-#-#-
|
|
@@ -280,16 +280,17 @@ def bin2dec_basic(b, procedure="loop"):
|
|
|
280
280
|
# Calculation #
|
|
281
281
|
###############
|
|
282
282
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
res = sum(summands_iter)
|
|
283
|
+
# Take the LSB at index 0 of reversed string — bit i contributes int(bit) * 2**i
|
|
284
|
+
b_lsb_first = b_checked[::-1]
|
|
286
285
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
for pos, i in enumerate(range(lb-1,-1,-1)):
|
|
290
|
-
res += int(b_checked[i]) * 2 ** pos
|
|
291
|
-
return res
|
|
286
|
+
if procedure == "list_comprehension":
|
|
287
|
+
return sum(int(b_lsb_first[i]) * 2**i for i in range(lb))
|
|
292
288
|
|
|
289
|
+
res = 0
|
|
290
|
+
for i in range(lb):
|
|
291
|
+
res += int(b_lsb_first[i]) * 2**i
|
|
292
|
+
return res
|
|
293
|
+
|
|
293
294
|
|
|
294
295
|
def oct2dec(n_oct):
|
|
295
296
|
"""
|
|
@@ -64,7 +64,7 @@ def format_string(string2format, arg_obj):
|
|
|
64
64
|
IndexError: If there are not enough indices referenced in the string to format.
|
|
65
65
|
SyntaxError: If there are syntax errors in the formatting object.
|
|
66
66
|
"""
|
|
67
|
-
bracket_index_list = find_substring_index(string2format, "{}",
|
|
67
|
+
bracket_index_list = find_substring_index(string2format, r"[{}]",
|
|
68
68
|
advanced_search=True,
|
|
69
69
|
all_matches=True)
|
|
70
70
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
"""
|
|
4
|
+
Optional climarraykit-backed helpers for NetCDF and dimension utilities.
|
|
5
|
+
|
|
6
|
+
Install with::
|
|
7
|
+
|
|
8
|
+
pip install 'pygenutils[climate]'
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from functools import cache
|
|
12
|
+
|
|
13
|
+
_INSTALL_MSG = (
|
|
14
|
+
"NetCDF / climarraykit features require optional dependencies. "
|
|
15
|
+
"Install with: pip install 'pygenutils[climate]'"
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@cache
|
|
20
|
+
def _ncfile_integrity_status_fn():
|
|
21
|
+
try:
|
|
22
|
+
from climarraykit.file_utils import ncfile_integrity_status
|
|
23
|
+
except ImportError as exc:
|
|
24
|
+
raise ImportError(_INSTALL_MSG) from exc
|
|
25
|
+
return ncfile_integrity_status
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def ncfile_integrity_status(*args, **kwargs):
|
|
29
|
+
"""Proxy to :func:`climarraykit.file_utils.ncfile_integrity_status` when ``[climate]`` is installed."""
|
|
30
|
+
return _ncfile_integrity_status_fn()(*args, **kwargs)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@cache
|
|
34
|
+
def _get_file_dimensions_fn():
|
|
35
|
+
try:
|
|
36
|
+
from climarraykit.patterns import get_file_dimensions
|
|
37
|
+
except ImportError as exc:
|
|
38
|
+
raise ImportError(_INSTALL_MSG) from exc
|
|
39
|
+
return get_file_dimensions
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def get_file_dimensions(*args, **kwargs):
|
|
43
|
+
"""Proxy to :func:`climarraykit.patterns.get_file_dimensions` when ``[climate]`` is installed."""
|
|
44
|
+
return _get_file_dimensions_fn()(*args, **kwargs)
|
|
@@ -169,13 +169,15 @@ def standardise_calendar(obj,
|
|
|
169
169
|
|
|
170
170
|
return obj_std_calendar
|
|
171
171
|
|
|
172
|
-
# Handling xarray datasets or data arrays
|
|
172
|
+
# Handling xarray datasets or data arrays (no xarray/climarraykit at module import;
|
|
173
|
+
# cftime_range and get_file_dimensions are loaded only for this branch)
|
|
173
174
|
elif obj_type in ["dataarray", "dataset"] \
|
|
174
175
|
or (obj_type == "list" and all(get_type_str(element) in ["dataarray", "dataset"]
|
|
175
176
|
for element in obj)):
|
|
176
177
|
|
|
177
178
|
from xarray import cftime_range
|
|
178
|
-
|
|
179
|
+
|
|
180
|
+
from ._optional_climate import get_file_dimensions
|
|
179
181
|
|
|
180
182
|
if isinstance(obj, list):
|
|
181
183
|
obj = obj[0] # Assuming only one object in the list
|
|
@@ -98,11 +98,20 @@ def __countdown(time_str, dt_fmt_str):
|
|
|
98
98
|
hours, minutes, seconds = dt_obj.hour, dt_obj.minute, dt_obj.second
|
|
99
99
|
|
|
100
100
|
if days > 0:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
dt_args_day = {
|
|
102
|
+
"days": days,
|
|
103
|
+
"hours": hours,
|
|
104
|
+
"minutes": minutes,
|
|
105
|
+
"seconds": seconds,
|
|
106
|
+
}
|
|
107
|
+
time_display = format_string(TIME_STR_PARTS_FMTS[0], dt_args_day)
|
|
108
|
+
else:
|
|
109
|
+
dt_args_noday = {
|
|
110
|
+
"hours": hours,
|
|
111
|
+
"minutes": minutes,
|
|
112
|
+
"seconds": seconds,
|
|
113
|
+
}
|
|
114
|
+
time_display = format_string(TIME_STR_PARTS_FMTS[1], dt_args_noday)
|
|
106
115
|
|
|
107
116
|
# Rellenar la cadena de visualización para limpiar caracteres sobrantes
|
|
108
117
|
# Pad the display string to clear any leftover characters
|
|
@@ -120,10 +129,20 @@ def __countdown(time_str, dt_fmt_str):
|
|
|
120
129
|
days -= 1
|
|
121
130
|
|
|
122
131
|
print("\nTime up!")
|
|
132
|
+
|
|
133
|
+
#---------------------------------#
|
|
134
|
+
# Define parameters and templates #
|
|
135
|
+
#---------------------------------#
|
|
136
|
+
|
|
137
|
+
# Named fields for format_string(..., dict); see pygenutils.strings.text_formatters.format_string.
|
|
138
|
+
TIME_STR_PARTS_FMTS = [
|
|
139
|
+
"{days} days {hours:02d}:{minutes:02d}:{seconds:02d}",
|
|
140
|
+
"{hours:02d}:{minutes:02d}:{seconds:02d}",
|
|
141
|
+
]
|
|
123
142
|
|
|
124
|
-
|
|
125
|
-
#
|
|
126
|
-
|
|
143
|
+
#---------------------#
|
|
144
|
+
# Program progression #
|
|
145
|
+
#---------------------#
|
|
127
146
|
|
|
128
147
|
# Ask for the datetime input #
|
|
129
148
|
DATETIME_STR = input("Introduce any time: ")
|
|
@@ -134,9 +153,3 @@ try:
|
|
|
134
153
|
__countdown(DATETIME_STR, DT_FMT_STR)
|
|
135
154
|
except KeyboardInterrupt:
|
|
136
155
|
print("\nCountdown stopped.")
|
|
137
|
-
|
|
138
|
-
#--------------------------#
|
|
139
|
-
# Parameters and constants #
|
|
140
|
-
#--------------------------#
|
|
141
|
-
|
|
142
|
-
TIME_STR_PARTS_FMTS = ["{} days {}:{}:{}", "{}:{}:{}"]
|
|
@@ -16,14 +16,12 @@ from datetime import datetime, timedelta, timezone
|
|
|
16
16
|
|
|
17
17
|
# Third-party modules #
|
|
18
18
|
import pandas as pd
|
|
19
|
-
import xarray as xr
|
|
20
19
|
|
|
21
20
|
#------------------------#
|
|
22
21
|
# Import project modules #
|
|
23
22
|
#------------------------#
|
|
24
23
|
|
|
25
24
|
from filewise.general.introspection_utils import get_caller_args, get_type_str
|
|
26
|
-
from filewise.xarray_utils.file_utils import ncfile_integrity_status
|
|
27
25
|
from pygenutils.arrays_and_lists.data_manipulation import flatten_list
|
|
28
26
|
from pygenutils.strings.string_handler import find_substring_index
|
|
29
27
|
from pygenutils.strings.text_formatters import format_string, print_format_string
|
|
@@ -36,6 +34,19 @@ try:
|
|
|
36
34
|
except ImportError:
|
|
37
35
|
pytz_installed = False
|
|
38
36
|
|
|
37
|
+
|
|
38
|
+
def _is_xarray_dataset_or_dataarray(obj):
|
|
39
|
+
"""
|
|
40
|
+
Return True if *obj* is an xarray Dataset or DataArray without importing xarray.
|
|
41
|
+
|
|
42
|
+
Used so this module can be imported without loading xarray unless a caller
|
|
43
|
+
passes xarray objects or NetCDF paths into the helpers that need it.
|
|
44
|
+
"""
|
|
45
|
+
cls = type(obj)
|
|
46
|
+
mod = getattr(cls, "__module__", "") or ""
|
|
47
|
+
return mod.startswith("xarray.") and cls.__name__ in ("Dataset", "DataArray")
|
|
48
|
+
|
|
49
|
+
|
|
39
50
|
#------------------#
|
|
40
51
|
# Define functions #
|
|
41
52
|
#------------------#
|
|
@@ -166,7 +177,7 @@ def get_current_datetime(dtype="datetime", time_fmt_str=None, tz_arg=None):
|
|
|
166
177
|
return current_time
|
|
167
178
|
|
|
168
179
|
# Date/time attributes and keys #
|
|
169
|
-
|
|
180
|
+
#-------------------------------#
|
|
170
181
|
|
|
171
182
|
def find_dt_key(data):
|
|
172
183
|
"""
|
|
@@ -192,6 +203,13 @@ def find_dt_key(data):
|
|
|
192
203
|
If the input data type is not supported.
|
|
193
204
|
ValueError
|
|
194
205
|
If no time-related key is found.
|
|
206
|
+
|
|
207
|
+
Notes
|
|
208
|
+
-----
|
|
209
|
+
This module does not import xarray at import time. ``xarray`` is imported
|
|
210
|
+
lazily only when *data* is a file path string. NetCDF path handling uses
|
|
211
|
+
``_optional_climate`` (requires ``pip install 'pygenutils[climate]'``) in
|
|
212
|
+
:func:`infer_frequency` / :func:`infer_dt_range`.
|
|
195
213
|
"""
|
|
196
214
|
|
|
197
215
|
# Common time-related keywords - both full words and prefixes
|
|
@@ -225,8 +243,8 @@ def find_dt_key(data):
|
|
|
225
243
|
|
|
226
244
|
raise ValueError("No time-related column found in the pandas DataFrame.")
|
|
227
245
|
|
|
228
|
-
# Handle xarray objects
|
|
229
|
-
elif
|
|
246
|
+
# Handle xarray objects (no top-level xarray import; see _is_xarray_dataset_or_dataarray)
|
|
247
|
+
elif _is_xarray_dataset_or_dataarray(data):
|
|
230
248
|
# First check dimensions
|
|
231
249
|
for dim in data.dims:
|
|
232
250
|
if check_exact_match(dim):
|
|
@@ -243,9 +261,11 @@ def find_dt_key(data):
|
|
|
243
261
|
|
|
244
262
|
raise ValueError("No time-related dimension or variable found in the xarray object.")
|
|
245
263
|
|
|
246
|
-
# Handle string (assumed to be file path)
|
|
264
|
+
# Handle string (assumed to be file path); xarray loaded only for this path
|
|
247
265
|
elif isinstance(data, str):
|
|
248
266
|
try:
|
|
267
|
+
import xarray as xr
|
|
268
|
+
|
|
249
269
|
ds = xr.open_dataset(data)
|
|
250
270
|
try:
|
|
251
271
|
time_key = find_dt_key(ds)
|
|
@@ -481,6 +501,9 @@ def infer_frequency(data):
|
|
|
481
501
|
not the index.
|
|
482
502
|
- For NetCDF files, the method can handle either file paths (strings) or already-opened
|
|
483
503
|
xarray.Dataset/xarray.DataArray objects.
|
|
504
|
+
- ``xarray`` and the climarraykit-backed helpers (via ``_optional_climate``) are
|
|
505
|
+
only loaded when this function enters the NetCDF / xarray branch. Install
|
|
506
|
+
``pygenutils[climate]`` for NetCDF path support.
|
|
484
507
|
"""
|
|
485
508
|
# Check input data type #
|
|
486
509
|
#########################
|
|
@@ -505,6 +528,8 @@ def infer_frequency(data):
|
|
|
505
528
|
###############################################################
|
|
506
529
|
|
|
507
530
|
elif obj_type == "str":
|
|
531
|
+
from ._optional_climate import ncfile_integrity_status
|
|
532
|
+
|
|
508
533
|
ds = ncfile_integrity_status(data)
|
|
509
534
|
elif obj_type in ["dataset", "dataarray"]:
|
|
510
535
|
ds = data.copy()
|
|
@@ -512,11 +537,9 @@ def infer_frequency(data):
|
|
|
512
537
|
raise TypeError("Unsupported data type. Must be pandas DataFrame, "
|
|
513
538
|
"Series, DatetimeIndex, TimedeltaIndex, "
|
|
514
539
|
"NetCDF file path (string), or xarray.Dataset/DataArray.")
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
import xarray as xr
|
|
519
|
-
|
|
540
|
+
|
|
541
|
+
import xarray as xr
|
|
542
|
+
|
|
520
543
|
# Infer time frequency for NetCDF data
|
|
521
544
|
date_key = find_dt_key(ds)
|
|
522
545
|
time_freq = xr.infer_freq(ds[date_key])
|
|
@@ -554,8 +577,8 @@ def infer_dt_range(data):
|
|
|
554
577
|
-----
|
|
555
578
|
- For pandas Series, the method will infer the date range based on the series values,
|
|
556
579
|
not the index.
|
|
557
|
-
- For NetCDF
|
|
558
|
-
|
|
580
|
+
- For NetCDF file paths, ``_optional_climate.ncfile_integrity_status`` is used
|
|
581
|
+
(requires ``pip install 'pygenutils[climate]'``); xarray is not loaded at module import time.
|
|
559
582
|
"""
|
|
560
583
|
# Check input data type #
|
|
561
584
|
obj_type = get_type_str(data, lowercase=True)
|
|
@@ -569,6 +592,8 @@ def infer_dt_range(data):
|
|
|
569
592
|
|
|
570
593
|
# Section 2: Handling NetCDF Files (string or xarray objects)
|
|
571
594
|
elif obj_type == "str":
|
|
595
|
+
from ._optional_climate import ncfile_integrity_status
|
|
596
|
+
|
|
572
597
|
ds = ncfile_integrity_status(data)
|
|
573
598
|
try:
|
|
574
599
|
date_key = find_dt_key(ds)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pygenutils
|
|
3
|
-
Version: 16.
|
|
3
|
+
Version: 16.4.0
|
|
4
4
|
Summary: A comprehensive Python utility library for general-purpose and specialised tasks
|
|
5
5
|
Author-email: Jon Ander Gabantxo <jagabantxo@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -43,10 +43,12 @@ Requires-Python: >=3.10
|
|
|
43
43
|
Description-Content-Type: text/markdown
|
|
44
44
|
License-File: LICENSE
|
|
45
45
|
Requires-Dist: more_itertools>=10.0.0
|
|
46
|
-
Requires-Dist: numpy
|
|
47
|
-
Requires-Dist: pandas
|
|
48
|
-
Requires-Dist: filewise>=3.
|
|
46
|
+
Requires-Dist: numpy>=2.2.3
|
|
47
|
+
Requires-Dist: pandas>=2.2.3
|
|
48
|
+
Requires-Dist: filewise>=3.13.0
|
|
49
49
|
Requires-Dist: paramlib>=3.4.10
|
|
50
|
+
Provides-Extra: climate
|
|
51
|
+
Requires-Dist: climarraykit>=0.1.0; extra == "climate"
|
|
50
52
|
Provides-Extra: xarray
|
|
51
53
|
Requires-Dist: xarray>=2024.2.0; extra == "xarray"
|
|
52
54
|
Provides-Extra: arrow
|
|
@@ -58,6 +60,7 @@ Requires-Dist: black>=23.0.0; extra == "dev"
|
|
|
58
60
|
Requires-Dist: isort>=5.0.0; extra == "dev"
|
|
59
61
|
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
60
62
|
Requires-Dist: flake8>=6.0.0; extra == "dev"
|
|
63
|
+
Requires-Dist: climarraykit>=0.1.0; extra == "dev"
|
|
61
64
|
Dynamic: license-file
|
|
62
65
|
|
|
63
66
|
# pygenutils
|
|
@@ -119,15 +122,18 @@ This package has minimal external dependencies and is designed to be lightweight
|
|
|
119
122
|
|
|
120
123
|
```bash
|
|
121
124
|
pip install pygenutils # Core functionality
|
|
122
|
-
pip install pygenutils[
|
|
125
|
+
pip install 'pygenutils[climate]' # NetCDF / climarraykit features in time_handling
|
|
126
|
+
pip install pygenutils[arrow] # Arrow support (optional)
|
|
123
127
|
```
|
|
124
128
|
|
|
125
|
-
|
|
129
|
+
Core install pulls **numpy**, **pandas**, **filewise**, **paramlib**, and **more_itertools**. **climarraykit** (and thus **xarray** for those code paths) is optional.
|
|
126
130
|
|
|
127
|
-
**
|
|
131
|
+
**Optional extras**:
|
|
128
132
|
|
|
129
|
-
- `pip install pygenutils`
|
|
130
|
-
- `pip install pygenutils[
|
|
133
|
+
- `pip install pygenutils` — core only (no climarraykit)
|
|
134
|
+
- `pip install 'pygenutils[climate]'` — NetCDF helpers (`ncfile_integrity_status`, `get_file_dimensions` proxies)
|
|
135
|
+
- `pip install pygenutils[arrow]` — Arrow for enhanced time handling
|
|
136
|
+
- `pip install pygenutils[xarray]` — xarray only (rare; prefer `[climate]` for climarraykit-backed APIs)
|
|
131
137
|
|
|
132
138
|
### Package Updates
|
|
133
139
|
|
|
@@ -154,7 +160,7 @@ cd pygenutils
|
|
|
154
160
|
pip install -e .[dev]
|
|
155
161
|
```
|
|
156
162
|
|
|
157
|
-
**Note**: The `-e` flag installs the package in "editable" mode
|
|
163
|
+
**Note**: The `-e` flag installs the package in "editable" mode. The `[dev]` extra includes development tools **and** `climarraykit` so time-handling tests and NetCDF code paths work without a separate `[climate]` install.
|
|
158
164
|
|
|
159
165
|
#### Alternative Setup (Explicit Git Dependencies)
|
|
160
166
|
|
|
@@ -168,11 +174,11 @@ cd pygenutils
|
|
|
168
174
|
# Install development dependencies from requirements-dev.txt
|
|
169
175
|
pip install -r requirements-dev.txt
|
|
170
176
|
|
|
171
|
-
# Install in editable mode
|
|
172
|
-
pip install -e .
|
|
177
|
+
# Install in editable mode (add [climate] if you skip Git climarraykit and need NetCDF features)
|
|
178
|
+
pip install -e .[dev]
|
|
173
179
|
```
|
|
174
180
|
|
|
175
|
-
This approach gives you
|
|
181
|
+
This approach gives you Git checkouts of **filewise**, **climarraykit**, and **paramlib** plus pinned scientific stack; use **`pip install -e .[dev]`** so editable **pygenutils** matches **`pyproject.toml`** (including dev + climarraykit).
|
|
176
182
|
|
|
177
183
|
#### Development with Optional Dependencies
|
|
178
184
|
|
|
@@ -183,7 +189,8 @@ For full development capabilities, including testing and linting:
|
|
|
183
189
|
pip install -e ".[dev]"
|
|
184
190
|
|
|
185
191
|
# Or install specific optional dependencies
|
|
186
|
-
pip install -e ".[
|
|
192
|
+
pip install -e ".[climate]" # climarraykit / NetCDF-related time_handling
|
|
193
|
+
pip install -e ".[xarray]" # xarray only (optional; [climate] is usually preferred)
|
|
187
194
|
```
|
|
188
195
|
|
|
189
196
|
### For Multiple Package Development
|
|
@@ -194,20 +201,22 @@ If you're working on multiple interdependent packages simultaneously:
|
|
|
194
201
|
# Clone all repositories
|
|
195
202
|
git clone https://github.com/EusDancerDev/pygenutils.git
|
|
196
203
|
git clone https://github.com/EusDancerDev/filewise.git
|
|
204
|
+
git clone https://github.com/EusDancerDev/climarraykit.git
|
|
197
205
|
git clone https://github.com/EusDancerDev/paramlib.git
|
|
198
206
|
|
|
199
|
-
# Install each in editable mode
|
|
207
|
+
# Install each in editable mode (order: dependencies first)
|
|
200
208
|
pip install -e ./filewise
|
|
201
209
|
pip install -e ./paramlib
|
|
202
|
-
pip install -e ./
|
|
210
|
+
pip install -e ./climarraykit
|
|
211
|
+
pip install -e ./pygenutils[dev]
|
|
203
212
|
```
|
|
204
213
|
|
|
205
214
|
### Troubleshooting
|
|
206
215
|
|
|
207
216
|
If you encounter import errors after cloning:
|
|
208
217
|
|
|
209
|
-
1. **For regular users**: Run `pip install pygenutils` (
|
|
210
|
-
2. **For developers**: Run `pip install -e .[dev]`
|
|
218
|
+
1. **For regular users**: Run `pip install pygenutils` (core dependencies) or `pip install 'pygenutils[climate]'` for NetCDF/climarraykit features
|
|
219
|
+
2. **For developers**: Run `pip install -e .[dev]` (includes dev tools and climarraykit)
|
|
211
220
|
3. **Verify Python environment**: Make sure you're using a compatible Python version (3.10+)
|
|
212
221
|
|
|
213
222
|
### Verify Installation
|
|
@@ -227,21 +236,16 @@ try:
|
|
|
227
236
|
|
|
228
237
|
except ImportError as e:
|
|
229
238
|
print(f"❌ Import error: {e}")
|
|
230
|
-
print("💡 For regular users: pip install pygenutils")
|
|
239
|
+
print("💡 For regular users: pip install pygenutils # add [climate] for NetCDF features")
|
|
231
240
|
print("💡 For developers: pip install -e .[dev]")
|
|
232
241
|
```
|
|
233
242
|
|
|
234
243
|
### Implementation Notes
|
|
235
244
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
- **
|
|
239
|
-
- **
|
|
240
|
-
- **Installation Methods**:
|
|
241
|
-
- **Regular users**: Simple `pip install pygenutils` with all dependencies included
|
|
242
|
-
- **Developers**: `pip install -e .[dev]` for latest Git versions and development tools
|
|
243
|
-
- **PyPI Compatibility**: All packages can be published without Git dependency issues
|
|
244
|
-
- **Development Flexibility**: Contributors get access to latest versions for testing and development
|
|
245
|
+
- **Core PyPI dependencies**: **more_itertools**, **numpy**, **pandas**, **filewise**, **paramlib**.
|
|
246
|
+
- **Optional `[climate]`**: **climarraykit** (pulls **xarray**) for NetCDF-related helpers in `time_handling`.
|
|
247
|
+
- **Optional `[dev]`**: development tools plus **climarraykit** for a full local test stack.
|
|
248
|
+
- **Git-based `requirements-dev.txt`**: optional bleeding-edge **filewise**, **climarraykit**, **paramlib** before `pip install -e .[dev]`.
|
|
245
249
|
|
|
246
250
|
### Package Structure
|
|
247
251
|
|
|
@@ -36,6 +36,7 @@ pygenutils/strings/__init__.py
|
|
|
36
36
|
pygenutils/strings/string_handler.py
|
|
37
37
|
pygenutils/strings/text_formatters.py
|
|
38
38
|
pygenutils/time_handling/__init__.py
|
|
39
|
+
pygenutils/time_handling/_optional_climate.py
|
|
39
40
|
pygenutils/time_handling/calendar_utils.py
|
|
40
41
|
pygenutils/time_handling/countdown.py
|
|
41
42
|
pygenutils/time_handling/date_and_time_maths.py
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
more_itertools>=10.0.0
|
|
2
|
-
numpy
|
|
3
|
-
pandas
|
|
4
|
-
filewise>=3.
|
|
2
|
+
numpy>=2.2.3
|
|
3
|
+
pandas>=2.2.3
|
|
4
|
+
filewise>=3.13.0
|
|
5
5
|
paramlib>=3.4.10
|
|
6
6
|
|
|
7
7
|
[arrow]
|
|
8
8
|
arrow>=1.2.0
|
|
9
9
|
|
|
10
|
+
[climate]
|
|
11
|
+
climarraykit>=0.1.0
|
|
12
|
+
|
|
10
13
|
[dev]
|
|
11
14
|
pytest>=7.0.0
|
|
12
15
|
pytest-cov>=4.0.0
|
|
@@ -14,6 +17,7 @@ black>=23.0.0
|
|
|
14
17
|
isort>=5.0.0
|
|
15
18
|
mypy>=1.0.0
|
|
16
19
|
flake8>=6.0.0
|
|
20
|
+
climarraykit>=0.1.0
|
|
17
21
|
|
|
18
22
|
[xarray]
|
|
19
23
|
xarray>=2024.2.0
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pygenutils"
|
|
7
|
-
version = "16.
|
|
7
|
+
version = "16.4.0"
|
|
8
8
|
license = {file = "LICENSE"}
|
|
9
9
|
description = "A comprehensive Python utility library for general-purpose and specialised tasks"
|
|
10
10
|
keywords = ["utilities", "python", "general-purpose", "file handling", "string processing"]
|
|
@@ -27,13 +27,16 @@ classifiers = [
|
|
|
27
27
|
]
|
|
28
28
|
dependencies = [
|
|
29
29
|
"more_itertools>=10.0.0",
|
|
30
|
-
"numpy>=
|
|
31
|
-
"pandas>=
|
|
32
|
-
"filewise>=3.
|
|
30
|
+
"numpy>=2.2.3",
|
|
31
|
+
"pandas>=2.2.3",
|
|
32
|
+
"filewise>=3.13.0",
|
|
33
33
|
"paramlib>=3.4.10",
|
|
34
34
|
]
|
|
35
35
|
|
|
36
36
|
[project.optional-dependencies]
|
|
37
|
+
climate = [
|
|
38
|
+
"climarraykit>=0.1.0",
|
|
39
|
+
]
|
|
37
40
|
xarray = ["xarray>=2024.2.0"]
|
|
38
41
|
arrow = ["arrow>=1.2.0"]
|
|
39
42
|
dev = [
|
|
@@ -43,6 +46,7 @@ dev = [
|
|
|
43
46
|
"isort>=5.0.0",
|
|
44
47
|
"mypy>=1.0.0",
|
|
45
48
|
"flake8>=6.0.0",
|
|
49
|
+
"climarraykit>=0.1.0",
|
|
46
50
|
]
|
|
47
51
|
|
|
48
52
|
[project.urls]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/audio_and_video/audio_and_video_manipulation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pygenutils-16.3.1 → pygenutils-16.4.0}/pygenutils/time_handling/program_snippet_exec_timers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|