Unifyt 0.2.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.
- unifyt-0.2.1/CHANGELOG.md +343 -0
- unifyt-0.2.1/CONTRIBUTING.md +173 -0
- unifyt-0.2.1/LICENSE +21 -0
- unifyt-0.2.1/MANIFEST.in +12 -0
- unifyt-0.2.1/PKG-INFO +333 -0
- unifyt-0.2.1/README.md +316 -0
- unifyt-0.2.1/Unifyt.egg-info/PKG-INFO +333 -0
- unifyt-0.2.1/Unifyt.egg-info/SOURCES.txt +49 -0
- unifyt-0.2.1/Unifyt.egg-info/dependency_links.txt +1 -0
- unifyt-0.2.1/Unifyt.egg-info/top_level.txt +1 -0
- unifyt-0.2.1/docs/CHECKLIST.md +318 -0
- unifyt-0.2.1/docs/FEATURES.md +342 -0
- unifyt-0.2.1/docs/MIGRATION.md +226 -0
- unifyt-0.2.1/docs/NEW_UNITS_v0.2.1.md +466 -0
- unifyt-0.2.1/docs/PERFORMANCE.md +271 -0
- unifyt-0.2.1/docs/RPM_CLARIFICATION.md +121 -0
- unifyt-0.2.1/docs/api_reference.md +302 -0
- unifyt-0.2.1/docs/user_guide.md +208 -0
- unifyt-0.2.1/examples/advanced_features.py +127 -0
- unifyt-0.2.1/examples/array_operations.py +76 -0
- unifyt-0.2.1/examples/basic_usage.py +52 -0
- unifyt-0.2.1/examples/complete_demo.py +250 -0
- unifyt-0.2.1/examples/custom_units.py +60 -0
- unifyt-0.2.1/examples/new_units_demo.py +255 -0
- unifyt-0.2.1/examples/scientific_calculations.py +60 -0
- unifyt-0.2.1/pyproject.toml +19 -0
- unifyt-0.2.1/setup.cfg +4 -0
- unifyt-0.2.1/setup.py +47 -0
- unifyt-0.2.1/tests/__init__.py +1 -0
- unifyt-0.2.1/tests/conftest.py +16 -0
- unifyt-0.2.1/tests/test_constants.py +74 -0
- unifyt-0.2.1/tests/test_context.py +37 -0
- unifyt-0.2.1/tests/test_dimensions.py +69 -0
- unifyt-0.2.1/tests/test_quantity.py +150 -0
- unifyt-0.2.1/tests/test_serialization.py +127 -0
- unifyt-0.2.1/tests/test_unit.py +100 -0
- unifyt-0.2.1/tests/test_unit_registry.py +38 -0
- unifyt-0.2.1/tests/test_utils.py +120 -0
- unifyt-0.2.1/tests/test_wire_gauge.py +201 -0
- unifyt-0.2.1/unifyt/__init__.py +158 -0
- unifyt-0.2.1/unifyt/constants.py +387 -0
- unifyt-0.2.1/unifyt/context.py +60 -0
- unifyt-0.2.1/unifyt/dimensions.py +142 -0
- unifyt-0.2.1/unifyt/exceptions.py +932 -0
- unifyt-0.2.1/unifyt/py.typed +1 -0
- unifyt-0.2.1/unifyt/quantity.py +254 -0
- unifyt-0.2.1/unifyt/serialization.py +206 -0
- unifyt-0.2.1/unifyt/unit.py +982 -0
- unifyt-0.2.1/unifyt/unit_registry.py +74 -0
- unifyt-0.2.1/unifyt/utils.py +373 -0
- unifyt-0.2.1/unifyt/wire_gauge.py +289 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added - New Units and Features 🚀
|
|
11
|
+
|
|
12
|
+
#### Wire Gauge Support
|
|
13
|
+
- **AWG (American Wire Gauge)**: Complete conversion table for gauges 0000, 000, 00, 0-44
|
|
14
|
+
- **SWG (Standard Wire Gauge)**: Complete conversion table for gauges 0-50
|
|
15
|
+
- **BWG (Birmingham Wire Gauge)**: Complete conversion table for gauges 0-36
|
|
16
|
+
- New `wire_gauge` module with bidirectional conversions (gauge ↔ diameter)
|
|
17
|
+
- Support for diameter in any length unit (mm, inch, etc.)
|
|
18
|
+
|
|
19
|
+
#### Torque Units
|
|
20
|
+
- `newton_meter`, `Nm`, `N_m` - SI torque unit
|
|
21
|
+
- `kilonewton_meter`, `kNm` - Large torque applications
|
|
22
|
+
- `foot_pound`, `ft_lb`, `foot_lb`, `pound_foot`, `lb_ft` - Imperial torque
|
|
23
|
+
- `inch_pound`, `in_lb`, `inch_lb` - Small fastener torque
|
|
24
|
+
|
|
25
|
+
#### Industrial Flow Units
|
|
26
|
+
- **Mass Flow**: `kilogram_per_second`, `kilogram_per_minute`, `kilogram_per_hour`, `ton_per_hour` (tph)
|
|
27
|
+
- **Volumetric Flow**: `cubic_meter_per_minute`, `cubic_meter_per_hour`, `cubic_foot_per_minute` (cfm), `cubic_foot_per_second` (cfs)
|
|
28
|
+
- Imperial mass flow: `pound_per_second`, `pound_per_minute`, `pound_per_hour`
|
|
29
|
+
|
|
30
|
+
#### Angular Velocity Units
|
|
31
|
+
- `radian_per_second`, `rad_s` - SI angular velocity
|
|
32
|
+
- `degree_per_second`, `deg_s` - Degrees per second
|
|
33
|
+
- `revolution_per_minute`, `rev_min` - Alternative to rpm
|
|
34
|
+
- `revolution_per_second`, `rev_s` - Revolutions per second
|
|
35
|
+
|
|
36
|
+
#### Paper/Fabric Weight
|
|
37
|
+
- `gsm`, `grams_per_square_meter` - Standard paper weight unit
|
|
38
|
+
|
|
39
|
+
#### Additional Specialized Units
|
|
40
|
+
- **Specific Energy**: `joule_per_kilogram`, `kilojoule_per_kilogram`, `megajoule_per_kilogram`, `calorie_per_gram`
|
|
41
|
+
- **Specific Volume**: `cubic_meter_per_kilogram`, `liter_per_kilogram`
|
|
42
|
+
- **Thermal Properties**: `calorie_per_gram_celsius`, `btu_per_pound_fahrenheit`
|
|
43
|
+
- **Surface Tension**: `newton_per_meter`, `dyne_per_centimeter`
|
|
44
|
+
- **Moment of Inertia**: `kilogram_meter_squared`, `gram_centimeter_squared`
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
- Updated `_BASE_UNITS` dictionary to include new derived unit dimensions
|
|
48
|
+
- Enhanced unit mapping system to support new unit categories
|
|
49
|
+
- Improved documentation with wire gauge examples
|
|
50
|
+
|
|
51
|
+
### Documentation
|
|
52
|
+
- Added `wire_gauge.py` module with comprehensive docstrings
|
|
53
|
+
- Created `examples/new_units_demo.py` showcasing all new units
|
|
54
|
+
- Added `tests/test_wire_gauge.py` with full test coverage
|
|
55
|
+
- Updated README.md with wire gauge and new unit examples
|
|
56
|
+
- Enhanced unit catalog documentation
|
|
57
|
+
|
|
58
|
+
## [0.2.0] - 2024-12-24
|
|
59
|
+
|
|
60
|
+
### Added - Major Feature Release 🚀
|
|
61
|
+
|
|
62
|
+
#### Units (200+ new units added - now 300+ total!)
|
|
63
|
+
|
|
64
|
+
**Astronomical Units**:
|
|
65
|
+
- kiloparsec, megaparsec
|
|
66
|
+
- nautical_mile, fathom, chain, furlong, league
|
|
67
|
+
- picometer, femtometer, fermi
|
|
68
|
+
|
|
69
|
+
**Atomic & Nuclear**:
|
|
70
|
+
- atomic_mass_unit, dalton
|
|
71
|
+
- electron_mass, proton_mass, neutron_mass
|
|
72
|
+
- solar_mass, earth_mass
|
|
73
|
+
- carat, grain, stone, slug
|
|
74
|
+
|
|
75
|
+
**Advanced Time**:
|
|
76
|
+
- picosecond, femtosecond, attosecond
|
|
77
|
+
- shake, fortnight, month, decade, century, millennium
|
|
78
|
+
|
|
79
|
+
**Advanced Energy**:
|
|
80
|
+
- megajoule, gigajoule, erg
|
|
81
|
+
- british_thermal_unit, therm, quad
|
|
82
|
+
- ton_tnt, kiloton_tnt, megaton_tnt
|
|
83
|
+
- rydberg, hartree
|
|
84
|
+
|
|
85
|
+
**Advanced Power**:
|
|
86
|
+
- gigawatt, terawatt
|
|
87
|
+
- milliwatt, microwatt, nanowatt
|
|
88
|
+
- metric_horsepower, boiler_horsepower
|
|
89
|
+
|
|
90
|
+
**Advanced Pressure**:
|
|
91
|
+
- gigapascal, millibar, microbar, barye
|
|
92
|
+
- technical_atmosphere
|
|
93
|
+
- inch_mercury, millimeter_mercury
|
|
94
|
+
|
|
95
|
+
**Advanced Force**:
|
|
96
|
+
- meganewton, dyne
|
|
97
|
+
- kilogram_force, gram_force, ton_force
|
|
98
|
+
- poundal, kip
|
|
99
|
+
|
|
100
|
+
**Advanced Frequency**:
|
|
101
|
+
- terahertz, millihertz
|
|
102
|
+
- rpm (revolutions per minute)
|
|
103
|
+
- rps (revolutions per second)
|
|
104
|
+
|
|
105
|
+
**Advanced Voltage**:
|
|
106
|
+
- megavolt, microvolt, nanovolt
|
|
107
|
+
- statvolt
|
|
108
|
+
|
|
109
|
+
**Advanced Current**:
|
|
110
|
+
- microampere, nanoampere, picoampere
|
|
111
|
+
- kiloampere, statampere
|
|
112
|
+
|
|
113
|
+
**Capacitance**:
|
|
114
|
+
- farad, millifarad, microfarad, nanofarad, picofarad
|
|
115
|
+
|
|
116
|
+
**Inductance**:
|
|
117
|
+
- henry, millihenry, microhenry, nanohenry
|
|
118
|
+
|
|
119
|
+
**Magnetic Field**:
|
|
120
|
+
- tesla, millitesla, microtesla, nanotesla
|
|
121
|
+
- gauss, milligauss
|
|
122
|
+
|
|
123
|
+
**Magnetic Flux**:
|
|
124
|
+
- weber, milliweber, maxwell
|
|
125
|
+
|
|
126
|
+
**Illuminance**:
|
|
127
|
+
- lux, foot_candle, phot
|
|
128
|
+
|
|
129
|
+
**Luminous Flux**:
|
|
130
|
+
- lumen
|
|
131
|
+
|
|
132
|
+
**Radioactivity**:
|
|
133
|
+
- becquerel, kilobecquerel, megabecquerel, gigabecquerel
|
|
134
|
+
- curie, millicurie, microcurie
|
|
135
|
+
- rutherford
|
|
136
|
+
|
|
137
|
+
**Absorbed Dose**:
|
|
138
|
+
- gray, milligray, rad
|
|
139
|
+
|
|
140
|
+
**Equivalent Dose**:
|
|
141
|
+
- sievert, millisievert, microsievert
|
|
142
|
+
- rem, millirem
|
|
143
|
+
|
|
144
|
+
**Catalytic Activity**:
|
|
145
|
+
- katal, unit (enzyme unit)
|
|
146
|
+
|
|
147
|
+
**Data/Information**:
|
|
148
|
+
- bit, byte
|
|
149
|
+
- kilobyte, megabyte, gigabyte, terabyte, petabyte
|
|
150
|
+
- kibibyte, mebibyte, gibibyte, tebibyte
|
|
151
|
+
|
|
152
|
+
**Velocity**:
|
|
153
|
+
- knot, mach
|
|
154
|
+
|
|
155
|
+
**Acceleration**:
|
|
156
|
+
- gal (galileo), standard_gravity
|
|
157
|
+
|
|
158
|
+
**Viscosity**:
|
|
159
|
+
- pascal_second, poise, centipoise (dynamic)
|
|
160
|
+
- stokes, centistokes (kinematic)
|
|
161
|
+
|
|
162
|
+
**Thermal Properties**:
|
|
163
|
+
- watt_per_meter_kelvin (thermal conductivity)
|
|
164
|
+
- joule_per_kelvin (heat capacity)
|
|
165
|
+
- joule_per_kilogram_kelvin (specific heat)
|
|
166
|
+
|
|
167
|
+
**Molar Mass**:
|
|
168
|
+
- gram_per_mole, kilogram_per_mole
|
|
169
|
+
|
|
170
|
+
**Concentration**:
|
|
171
|
+
- molar, millimolar, micromolar, nanomolar
|
|
172
|
+
|
|
173
|
+
**Density**:
|
|
174
|
+
- kilogram_per_cubic_meter
|
|
175
|
+
- gram_per_cubic_centimeter
|
|
176
|
+
- gram_per_liter
|
|
177
|
+
|
|
178
|
+
**Flow Rate**:
|
|
179
|
+
- cubic_meter_per_second
|
|
180
|
+
- liter_per_second, liter_per_minute
|
|
181
|
+
- gallon_per_minute
|
|
182
|
+
|
|
183
|
+
**Fuel Efficiency**:
|
|
184
|
+
- mile_per_gallon, kilometer_per_liter
|
|
185
|
+
- liter_per_100km
|
|
186
|
+
|
|
187
|
+
**Angle**:
|
|
188
|
+
- arcminute, arcsecond, gradian
|
|
189
|
+
|
|
190
|
+
**Dimensionless**:
|
|
191
|
+
- ppt (parts per trillion)
|
|
192
|
+
|
|
193
|
+
#### Constants (50+ new constants added - now 80+ total!)
|
|
194
|
+
|
|
195
|
+
**Electromagnetic**:
|
|
196
|
+
- Faraday constant (F)
|
|
197
|
+
- Vacuum impedance (Z_0)
|
|
198
|
+
- Conductance quantum (G_0)
|
|
199
|
+
- Josephson constant (K_J)
|
|
200
|
+
- Von Klitzing constant (R_K)
|
|
201
|
+
- Magnetic flux quantum (Phi_0)
|
|
202
|
+
- Bohr magneton (mu_B)
|
|
203
|
+
- Nuclear magneton (mu_N)
|
|
204
|
+
- Proton/electron/neutron magnetic moments
|
|
205
|
+
- Proton gyromagnetic ratio
|
|
206
|
+
|
|
207
|
+
**Radiation**:
|
|
208
|
+
- Wien displacement constant
|
|
209
|
+
- First radiation constant
|
|
210
|
+
- Second radiation constant
|
|
211
|
+
|
|
212
|
+
**Atomic & Particle**:
|
|
213
|
+
- Compton wavelength
|
|
214
|
+
- Classical electron radius
|
|
215
|
+
- Thomson cross section
|
|
216
|
+
- Electron g-factor
|
|
217
|
+
- Muon mass
|
|
218
|
+
- Tau mass
|
|
219
|
+
|
|
220
|
+
**Planck Units**:
|
|
221
|
+
- Planck length (l_P)
|
|
222
|
+
- Planck mass (m_P)
|
|
223
|
+
- Planck time (t_P)
|
|
224
|
+
- Planck temperature (T_P)
|
|
225
|
+
- Planck energy (E_P)
|
|
226
|
+
|
|
227
|
+
**Cosmological**:
|
|
228
|
+
- Hubble constant (H_0)
|
|
229
|
+
- CMB temperature (T_CMB)
|
|
230
|
+
- Age of universe
|
|
231
|
+
- Critical density (rho_c)
|
|
232
|
+
|
|
233
|
+
**Solar System**:
|
|
234
|
+
- Solar luminosity (L_sun)
|
|
235
|
+
- Solar radius (R_sun)
|
|
236
|
+
- Jupiter mass (M_jupiter)
|
|
237
|
+
- Moon mass (M_moon)
|
|
238
|
+
- Schwarzschild radii (Earth, Sun)
|
|
239
|
+
|
|
240
|
+
### Changed
|
|
241
|
+
- Version bumped to 0.2.0
|
|
242
|
+
- Documentation updated across all files
|
|
243
|
+
- Examples updated with new units
|
|
244
|
+
- API reference expanded
|
|
245
|
+
|
|
246
|
+
### Performance
|
|
247
|
+
- No performance degradation
|
|
248
|
+
- Unit caching maintained
|
|
249
|
+
- Memory efficient despite 3x more units
|
|
250
|
+
|
|
251
|
+
## [0.1.0] - 2024-12-24
|
|
252
|
+
|
|
253
|
+
### Added
|
|
254
|
+
- Initial release of Unifyt
|
|
255
|
+
- Core `Quantity` class for representing values with units
|
|
256
|
+
- `Unit` class for unit management and conversions
|
|
257
|
+
- `Dimension` class for tracking physical dimensions
|
|
258
|
+
- `UnitRegistry` for custom unit definitions
|
|
259
|
+
- `UnitContext` for unit system management
|
|
260
|
+
- Support for 100+ units including:
|
|
261
|
+
- Basic SI units (length, mass, time, etc.)
|
|
262
|
+
- Imperial units
|
|
263
|
+
- Energy units (joule, calorie, kWh, eV)
|
|
264
|
+
- Power units (watt, horsepower)
|
|
265
|
+
- Pressure units (pascal, bar, atm, psi)
|
|
266
|
+
- Force units (newton, pound_force)
|
|
267
|
+
- Frequency units (hertz, MHz, GHz)
|
|
268
|
+
- Voltage and electrical units
|
|
269
|
+
- Volume units (liter, gallon)
|
|
270
|
+
- Angle units (radian, degree)
|
|
271
|
+
- Physical constants module with 30+ constants:
|
|
272
|
+
- Fundamental constants (c, h, G, k_B, etc.)
|
|
273
|
+
- Astronomical constants (AU, ly, M_sun, etc.)
|
|
274
|
+
- Atomic constants (a_0, m_e, m_p, etc.)
|
|
275
|
+
- Utility functions module:
|
|
276
|
+
- Array creation (linspace, arange, zeros, ones, full)
|
|
277
|
+
- Array operations (concatenate, stack)
|
|
278
|
+
- Statistical functions (sum, mean, std, min, max)
|
|
279
|
+
- Mathematical functions (sqrt, clip, isclose)
|
|
280
|
+
- Serialization support:
|
|
281
|
+
- JSON serialization/deserialization
|
|
282
|
+
- Pickle support
|
|
283
|
+
- File save/load functions
|
|
284
|
+
- Custom JSON encoder/decoder
|
|
285
|
+
- Performance optimizations:
|
|
286
|
+
- Unit caching for faster parsing
|
|
287
|
+
- Efficient dimension checking
|
|
288
|
+
- NumPy vectorization
|
|
289
|
+
- Comprehensive test suite with 50+ tests
|
|
290
|
+
- Full documentation:
|
|
291
|
+
- User guide with examples
|
|
292
|
+
- Complete API reference
|
|
293
|
+
- Performance guide
|
|
294
|
+
- Migration guide from Pint/Unyt
|
|
295
|
+
- Feature documentation
|
|
296
|
+
- Example scripts:
|
|
297
|
+
- Basic usage examples
|
|
298
|
+
- Scientific calculations
|
|
299
|
+
- Custom unit definitions
|
|
300
|
+
- Array operations
|
|
301
|
+
- Advanced features (constants, utils, serialization)
|
|
302
|
+
- Development tools:
|
|
303
|
+
- Setup script
|
|
304
|
+
- Test runner
|
|
305
|
+
- Code formatter
|
|
306
|
+
- Code quality checker
|
|
307
|
+
- Type hints for better IDE support
|
|
308
|
+
- Full PEP 561 compliance
|
|
309
|
+
|
|
310
|
+
### Features
|
|
311
|
+
- Intuitive API for creating and manipulating quantities
|
|
312
|
+
- Automatic unit conversion in arithmetic operations
|
|
313
|
+
- Support for compound units (e.g., meter/second)
|
|
314
|
+
- Array operations with NumPy integration
|
|
315
|
+
- Custom unit definitions
|
|
316
|
+
- Unit system contexts
|
|
317
|
+
- Comparison operations
|
|
318
|
+
- Power operations
|
|
319
|
+
- Dimensionality checking
|
|
320
|
+
- Physical constants with proper units
|
|
321
|
+
- Utility functions for common operations
|
|
322
|
+
- Serialization to JSON and pickle
|
|
323
|
+
|
|
324
|
+
### Documentation
|
|
325
|
+
- User guide with comprehensive examples
|
|
326
|
+
- Complete API reference
|
|
327
|
+
- Quick start guide
|
|
328
|
+
- Performance optimization guide
|
|
329
|
+
- Migration guide from other libraries
|
|
330
|
+
- Contributing guidelines
|
|
331
|
+
- README with feature overview
|
|
332
|
+
- Inline documentation with docstrings
|
|
333
|
+
|
|
334
|
+
### Performance
|
|
335
|
+
- Unit caching reduces parsing overhead
|
|
336
|
+
- NumPy integration for vectorized operations
|
|
337
|
+
- Efficient dimension tracking
|
|
338
|
+
- Optimized conversion calculations
|
|
339
|
+
- 2-5x faster than Pint for array operations
|
|
340
|
+
|
|
341
|
+
[Unreleased]: https://github.com/MEERAN2314/unifyt/compare/v0.2.0...HEAD
|
|
342
|
+
[0.2.0]: https://github.com/MEERAN2314/unifyt/releases/tag/v0.2.0
|
|
343
|
+
[0.1.0]: https://github.com/MEERAN2314/unifyt/releases/tag/v0.1.0
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Contributing to Unifyt
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to Unifyt! This document provides guidelines and instructions for contributing.
|
|
4
|
+
|
|
5
|
+
## Code of Conduct
|
|
6
|
+
|
|
7
|
+
Be respectful and inclusive. We welcome contributions from everyone.
|
|
8
|
+
|
|
9
|
+
## How to Contribute
|
|
10
|
+
|
|
11
|
+
### Reporting Bugs
|
|
12
|
+
|
|
13
|
+
If you find a bug, please open an issue with:
|
|
14
|
+
- A clear description of the problem
|
|
15
|
+
- Steps to reproduce
|
|
16
|
+
- Expected vs actual behavior
|
|
17
|
+
- Your environment (Python version, OS, etc.)
|
|
18
|
+
|
|
19
|
+
### Suggesting Features
|
|
20
|
+
|
|
21
|
+
Feature requests are welcome! Please:
|
|
22
|
+
- Check if the feature already exists or is planned
|
|
23
|
+
- Describe the use case clearly
|
|
24
|
+
- Explain why it would be useful
|
|
25
|
+
|
|
26
|
+
### Contributing Code
|
|
27
|
+
|
|
28
|
+
1. **Fork the repository**
|
|
29
|
+
```bash
|
|
30
|
+
git clone https://github.com/yourusername/unifyt.git
|
|
31
|
+
cd unifyt
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
2. **Create a virtual environment**
|
|
35
|
+
```bash
|
|
36
|
+
python -m venv venv
|
|
37
|
+
source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
3. **Install development dependencies**
|
|
41
|
+
```bash
|
|
42
|
+
pip install -e ".[dev]"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
4. **Create a feature branch**
|
|
46
|
+
```bash
|
|
47
|
+
git checkout -b feature/your-feature-name
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
5. **Make your changes**
|
|
51
|
+
- Write clear, documented code
|
|
52
|
+
- Follow the existing code style
|
|
53
|
+
- Add tests for new functionality
|
|
54
|
+
- Update documentation as needed
|
|
55
|
+
|
|
56
|
+
6. **Run tests**
|
|
57
|
+
```bash
|
|
58
|
+
pytest tests/
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
7. **Check code quality**
|
|
62
|
+
```bash
|
|
63
|
+
# Format code
|
|
64
|
+
black unifyt/ tests/
|
|
65
|
+
isort unifyt/ tests/
|
|
66
|
+
|
|
67
|
+
# Lint
|
|
68
|
+
flake8 unifyt/
|
|
69
|
+
|
|
70
|
+
# Type check
|
|
71
|
+
mypy unifyt/
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
8. **Commit your changes**
|
|
75
|
+
```bash
|
|
76
|
+
git add .
|
|
77
|
+
git commit -m "Add feature: description"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
9. **Push and create a pull request**
|
|
81
|
+
```bash
|
|
82
|
+
git push origin feature/your-feature-name
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Development Guidelines
|
|
86
|
+
|
|
87
|
+
### Code Style
|
|
88
|
+
|
|
89
|
+
- Follow PEP 8
|
|
90
|
+
- Use type hints
|
|
91
|
+
- Write docstrings for all public APIs
|
|
92
|
+
- Keep functions focused and small
|
|
93
|
+
- Use meaningful variable names
|
|
94
|
+
|
|
95
|
+
### Testing
|
|
96
|
+
|
|
97
|
+
- Write tests for all new features
|
|
98
|
+
- Maintain or improve code coverage
|
|
99
|
+
- Test edge cases
|
|
100
|
+
- Use descriptive test names
|
|
101
|
+
|
|
102
|
+
### Documentation
|
|
103
|
+
|
|
104
|
+
- Update docstrings
|
|
105
|
+
- Add examples for new features
|
|
106
|
+
- Update user guide if needed
|
|
107
|
+
- Keep API reference current
|
|
108
|
+
|
|
109
|
+
### Commit Messages
|
|
110
|
+
|
|
111
|
+
- Use clear, descriptive messages
|
|
112
|
+
- Start with a verb (Add, Fix, Update, etc.)
|
|
113
|
+
- Reference issues when applicable
|
|
114
|
+
|
|
115
|
+
## Project Structure
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
unifyt/
|
|
119
|
+
├── unifyt/ # Main package
|
|
120
|
+
│ ├── __init__.py
|
|
121
|
+
│ ├── quantity.py # Quantity class
|
|
122
|
+
│ ├── unit.py # Unit class
|
|
123
|
+
│ ├── dimensions.py # Dimension class
|
|
124
|
+
│ ├── unit_registry.py
|
|
125
|
+
│ └── context.py
|
|
126
|
+
├── tests/ # Test suite
|
|
127
|
+
├── examples/ # Example scripts
|
|
128
|
+
├── docs/ # Documentation
|
|
129
|
+
└── setup.py # Package configuration
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Testing
|
|
133
|
+
|
|
134
|
+
Run the full test suite:
|
|
135
|
+
```bash
|
|
136
|
+
pytest tests/ -v
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Run with coverage:
|
|
140
|
+
```bash
|
|
141
|
+
pytest tests/ --cov=unifyt --cov-report=html
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Run specific tests:
|
|
145
|
+
```bash
|
|
146
|
+
pytest tests/test_quantity.py
|
|
147
|
+
pytest tests/test_quantity.py::TestQuantityCreation
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Documentation
|
|
151
|
+
|
|
152
|
+
Build documentation locally:
|
|
153
|
+
```bash
|
|
154
|
+
cd docs
|
|
155
|
+
# Add your documentation build commands here
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Release Process
|
|
159
|
+
|
|
160
|
+
(For maintainers)
|
|
161
|
+
|
|
162
|
+
1. Update version in `setup.py` and `unifyt/__init__.py`
|
|
163
|
+
2. Update `CHANGELOG.md`
|
|
164
|
+
3. Create a git tag
|
|
165
|
+
4. Build and upload to PyPI
|
|
166
|
+
|
|
167
|
+
## Questions?
|
|
168
|
+
|
|
169
|
+
Feel free to open an issue for any questions about contributing.
|
|
170
|
+
|
|
171
|
+
## License
|
|
172
|
+
|
|
173
|
+
By contributing, you agree that your contributions will be licensed under the MIT License.
|
unifyt-0.2.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Unifyt Contributors
|
|
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.
|
unifyt-0.2.1/MANIFEST.in
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include CHANGELOG.md
|
|
4
|
+
include CONTRIBUTING.md
|
|
5
|
+
include pyproject.toml
|
|
6
|
+
recursive-include unifyt *.py
|
|
7
|
+
recursive-include unifyt py.typed
|
|
8
|
+
recursive-include docs *.md
|
|
9
|
+
recursive-include examples *.py
|
|
10
|
+
recursive-include tests *.py
|
|
11
|
+
global-exclude __pycache__
|
|
12
|
+
global-exclude *.py[co]
|