Releases: rannd1nt/phaethon
Release list
Release Notes 0.4.2 - Stochastic Hotfix
A critical hotfix release following the 0.4.x series. This update addresses a fatal initialization bug in the stochastic physics engine and enhances the framework's internal documentation for better IDE discoverability.
Stochastic Hotfix (AttributeError)
We discovered that in v0.4.1, the RandomState engine would fail with an AttributeError if a user attempted to generate random values without first calling ptn.random.seed().
- The Fix: Re-implemented the
__init__constructor forRandomStateto ensure the internal BitGenerator (_rng) is instantiated immediately upon package import.
Metadata & Documentation Refinery
- Rich Docstrings: Overhauled the package-level documentation in
__init__.py. When inspecting Phaethon in high-end IDEs (VS Code, PyCharm), you will now see a structured architectural overview of the framework's core modules (Units, Schema, Dataset, ML, PINNs) along with clickable documentation links.
Release Notes 0.4.1 - Stability, Type Refinery & Isolated Stochastic Engine
This release marks a significant milestone in framework stability and developer experience. We've tackled the "Ouroboros" recursion bugs, refined our static typing engine, and deployed a completely isolated stochastic physics module.
Algebraic Stability
- Recursion Guard: Fixed the
Ouroborosbug where complex unit synthesis could trigger infinite recursion. - Context Preservation: Fixed the "Amnesia" bug; environmental contexts (like FX rates) now persist through every step of the conversion pipeline.
- Strict Semantics: Better guardrails for bitwise operations on anonymous units.
Stochastic Physics Engine
We have overhauled phaethon.random to move away from global NumPy state.
- Isolated RNG: Using
np.random.default_rng(), your physics simulations are now thread-safe and reproducible viaptn.random.seed(). - New Methods: Added
randint,choice,shuffle, andpermutation—all natively aware of physical dimensions.
Developer Experience (DX)
- Stub Refinery: New
.pyifiles provide perfect IDE highlighting (Variables appear Blue/Callable) with full parameter autocompletion. - Ragged Masking:
phaethon.Datasetnow supports advanced boolean masking for complex data filtering. - SEO & Docs: Fixed social preview cards on ReadTheDocs for better documentation sharing.
Release Notes 0.4.0 - The Sci-ML, Neural PDEs, and Rust Parsing Overhaul
Version 0.4.0 represents the most massive architectural leap in Phaethon's history. The framework has evolved from a dimensional data pipeline into a comprehensive Scientific Machine Learning (Sci-ML) ecosystem. We have deeply integrated PyTorch and Scikit-Learn, deployed a zero-allocation Rust backend, and expanded our native physics capabilities to encompass complex differential calculus and linear algebra.
Deep PyTorch Integration (Neural PDEs & PINNs)
Phaethon now ships with the phaethon.pinns module. At its core is the PTensor—a strict PyTorch autograd subclass injected with dimensional DNA. You can now execute native differential calculus (pnn.grad, pnn.laplace, pnn.div, pnn.curl) across the computational graph, automatically synthesizing derivative physical units.
Furthermore, training loops are now guarded by Physics-Informed Loss Tribunals (ResidualLoss and AxiomLoss), violently enforcing equation balancing and physical boundaries during backpropagation. The update also introduces Spectral Convolutions (SpectralConv1d) and SVD projection layers (BuckinghamPi) for advanced Neural Operator architectures.
Classic Sci-ML & Scientific Computing
For traditional machine learning, we've introduced Scikit-Learn Meta-Estimators (DimensionalEstimator, AxiomValidator) that automatically infer training dimensions, safely strip units for high-speed C/Cython execution, and resurrect exact physical units on final predictions.
The newly introduced phaethon.linalg and phaethon.random modules extend physical tracking into matrix inversions, determinants, and stochastic distributions natively built atop NumPy.
Rust-Powered Data Engineering & Polyglot I/O
The heavy string-extraction layer has been rewritten entirely in Rust via PyO3/Maturin (phaethon._rust_core). This custom backend bypasses the Python GIL, natively executing min/max physical boundaries and semantic clipping directly at the memory level for extreme-speed parsing.
Once normalized, data pipelines can be seamlessly bridged into Deep Learning via Schema.astensor(), which automatically factorizes semantic string concepts into integer tensors. Finally, the new phaethon.Dataset securely serializes complex physical tensors to disk using .phx archives (equipped with cryptographic SHA-256 integrity validation), .parquet, and .h5 formats.
Breaking Changes & Migration
- Python 3.11+: Phaethon now drops support for Python 3.10 to leverage advanced typing and structural pattern matching.
- Build System: The package is now compiled via
maturininstead ofsetuptools. - Deprecation: The legacy list syntax in
@axiom.derive(mul=[...], div=[...])is deprecated in favor of direct mathematical metaclass synthesis.
Release Notes 0.3.1 - Polars Optional Dependency Hotfix
This is a rapid hotfix release addressing a critical startup crash for users operating in Pandas-only environments.
Bug Fixes
- fix(compat): While Polars was correctly defined as an optional dependency in
pyproject.toml, internal engine imports were previously unguarded. We have introduced strictHAS_POLARSruntime flags across the compatibility and backend layers. Phaethon now boots flawlessly regardless of which backend (Pandas or Polars) is present in the host environment.
Release Notes 0.3.0 - The Industrial FinTech, Majestic DX Update & Polars Support
This release marks a major architectural leap, consolidating high-performance data engineering with physical, financial, and semantic intelligence. Version 0.3.0 introduces native Polars support via Rust-backed expressions, a multi-tier configuration hierarchy, massive dimensional expansions, and a complete overhaul of Developer Experience (DX) utilizing Python 3.10+ declarative standards.
High-Performance Backends
- feat(polars): Introduced native support for
polars.DataFrameas an optional dependency (installable via[polars]or[all]). Phaethon now implements a backend-agnostic protocol that detects Polars objects and executes normalization using high-speed Polars Expressions (pl.Expr). - feat(engine): Developed a vectorized NumPy bridge via
map_batchesfor Polars, allowing complex physical axiom validation to run at near-native speeds while maintaining 100% mathematical parity with the Pandas engine. - feat(engine): Implemented a "NaN Sweeper" and "Struct Wrapper" logic for the Polars backend to ensure that regex-rejected strings and axiom violations are correctly neutralized to
nullvalues, matching the behavior of the established Pandas engine.
Dimensional Core & Tensor Algebra
- feat(api): Overhauled the Fluent Data Engineering API (
ptn.convert().to().use().context().resolve()). This chainable, lazily-evaluated builder pattern now fully supports lists of Phaethon objects, N-dimensional NumPy tensors, mixed-unit iterables, and raw scalars natively without Python loop overheads on vectorized operations. - feat(api): Implemented strict calculation engine interception via
.use(dtype=...). The pipeline automatically handles safe upcasting to high-precisionDecimal(bypassing native Python float degradation via string casting) and strict downcasting tofloat64for raw performance before dimensional algebra is executed. - feat(api): Upgraded OOP Conversion Interface. The
BaseUnit.to()method now accepts localized, on-the-fly context injections (obj.to(Target, context={...})). This allows safe, isolated financial conversions without mutating the underlying object's state or relying on global configs. - feat(tensor): Integrated native NumPy proxying directly into
BaseUnit. Instances wrapping NumPy arrays now natively support array slicing (__getitem__), properties (shape,ndim,T), and shape manipulation (reshape,flatten) while preserving their physical unit wrappers. - feat(vmath): Added native vectorized statistical methods to
BaseUnit(sum,mean,max,min). Reductions along specific axes now correctly return structurally instantiated physical tensors rather than nakedfloat64arrays. - feat(algebra): Engineered Syntactic Sugar for Cross-Entity Operations and Dimensionless Collapse. The physics engine seamlessly executes mathematics between Instances and naked Classes implicitly. Furthermore, operations that mathematically cancel out (e.g.,
u.Meter / u.Meter) now intelligently collapse into a dimensionlessBaseUnitobject rather than a primitivefloat, preserving strict OOP API contracts. - feat(algebra): Introduced Class-Level Hierarchy Comparisons (
<,>,<=,>=). Developers can inherently sort and validate unit hierarchies without instantiating them (e.g.,u.Gigabyte > u.Megabytenatively evaluates toTrue). - feat(algebra): Engineered Dynamic Context Inheritance for Derived Units. Metaclass-synthesized units (e.g.,
Euro / Gram) now dynamically evaluate their base multipliers at runtime. This guarantees that complex econo-physics units instantly react to real-timecontextinjections without suffering from static multiplier lock-in. - feat(operators): Implemented advanced physics dunder methods. The engine now fully supports Matrix Multiplication / Dot Products (
@) for dimensional synthesis, Floor Division (//) for discrete quantization, Modulo (%) for phase/cycle resets, and vector manipulations (-,+,abs,round). - fix(engine): Overhauled the
_normalize_typesmathematical router. Eliminated forcedDecimalcasting ("The Decimal Dictatorship"). The engine now dynamically preserves nativefloat64for maximum computational speed, only escalating to high-precisionDecimalmathematics when explicitly requested by the user. - fix(security): Eradicated Global Mutable State in the dimensional registry. The
_DIMENSIONAL_DNAis now strictly encapsulated within a private singleton (_PhysicsGenome) utilizing Python name mangling (__dna), preventing accidental global namespace pollution or malicious mutation of physical axioms.
Semantic Intelligence & Machine Learning
- feat(semantics): Introduced the Declarative Semantic Transformation API (
ptn.Ontology,ptn.Concept,ptn.SemanticState,ptn.Condition). Users can now map discrete raw strings to canonical concepts, or classify continuous physical vectors into discrete logical states strictly bounded by dimensional physics (e.g., mappingu.Celsiusranges into "Cold", "Warm", "Hot"). - feat(semantics): Integrated RapidFuzz (now promoted to a mandatory core dependency) for Vectorized Semantic Matching. Added
fuzzy_match=Trueandconfidencethresholds toptn.Field, enabling the engine to automatically auto-correct typos in categorical/ontology data using C++ string metrics. - feat(schema): Introduced
ptn.DerivedFieldandptn.col(). Users can now synthesize new Machine Learning features (e.g., computing Power from Voltage and Current) safely across dimensional bounds via a custom Abstract Syntax Tree (AST) evaluator. - feat(schema): Implemented
Schema.blueprint(). Generates a strict, JSON-serializableTypedDictstructural blueprint of the schema, perfect for automated Data Catalogs and enterprise Data Governance.
Tiered Configuration & Industrial Quality
- feat(config): Engineered a 3-Tier Configuration Hierarchy for managing engine state (Global -> Block -> Field). This allows for thread-safe localization (decimal marks/thousands separators) and dynamic alias management without global state pollution.
- feat(schema): Added Physics-Aware Boundaries (
min,max) toptn.Field. The engine now automatically performs cross-unit conversion before evaluating boundary constraints (e.g., rejecting "120 lbs" against a "50 kg" limit). - feat(schema): Introduced Dimensional Imputation (
impute_by) and Statistical Anomaly Rejection (outlier_std). Users can rescueNaNvalues using statistical methods ("mean", "median", "mode") or physically identify and neutralize data points exceeding a specified Standard Deviation (Z-Score). - feat(engine): Expanded
on_error='clip'Behavior. The pipeline now correctly forces invalid numbers to strictly attach to the nearest mathematical bound defined by either the user's Schemamin/maxor the unit's intrinsic@axiom.boundlimit across both Pandas and Polars backends. - feat(engine): Introduced "God Mode" (
ignore_axiom_bound=True). Developers can now strategically override and bypass all intrinsic physical laws (e.g., allowing temperatures below Absolute Zero) for experimental testing and simulation logic, deployable via Field, Block (using), or Global Config.
Majestic Developer Experience (DX) & Typing Overhaul
- feat(dx): Engineered "Type-State" Generic Overloads for the Fluent API. The
_ConversionBuilderis now a trueGeneric[_T_Out]. Deployed 5 precise@overloadsignatures forconvert()and 16 massive overloads for.use()to completely eradicateAnytypes. IDEs now perfectly predict the exact structural return type of.resolve()(locking toDecimal,list[BaseUnit],list[float],str, ornp.ndarray). Also refactored.use()parameters: renamedmodetodtypeandformattooutfor a more native Data Science feel. - feat(dx): Implemented the IDE Tooltip Hack (
__init__routing). Docstrings for highly complex declarative classes (ptn.Field,ptn.Concept,ptn.Condition) have been surgically routed to their__init__methods. Strict IDEs (VS Code/Pylance) will now reliably render comprehensive parameter tooltips during instantiation. - fix(dx): Eliminated Union Method Pollution. By surgically separating scalar, iterable, and array type-hints at the
convert()entry point, strict IDEs (Pylance/Mypy) no longer hallucinate NumPy array methods on simple floating-point scalars. - refactor(typing): Upgraded minimum requirement to Python 3.10+. The entire codebase has been refactored to utilize PEP 604 (
|operator) and native types, discarding legacytypingmodules for an incredibly clean, "Majestic" code structure. - refactor(typing): Enforced absolute boundary separation between Metaclass (Blueprint) and Instance operations. Purged
Anyfallbacks in_PhaethonUnitMetareturn types. Strict IDEs now structurally recognize dynamically synthesized units as formal Classes (semantic highlighting), fully activating constructor autocompletion. - refactor(typing): Formalized unified type aliases (
ConvertibleInput,ContextDict,ErrorAction,ImputeMethod, etc) across the physics engine. This provides crystal-clear signature documentation for scalar, NumPy array, and unit instance inputs. - feat(typing): Added PEP 561
py.typedcompliance. IDEs (VS Code, PyCharm) and strict Type Checkers (Mypy, Pylance) now fully recognize Phaethon's complex@overloadsignatures,TypeVargenerics, andProtocolbindings. - fix(typing): Resolved strict type hinting for core properties (
.mag,.exact) using explicit unions (float | np.ndarray | Decimal), successfully activating full IDE intelligence and autocomplete for NumPy array methods. - feat(dx): Implemented Dynamic Metaclass Docstrings. Dynamically synthesized classes (e.g., `Me...
Release Notes 0.2.3 - The Quantum Precision Patch
This release solidifies Phaethon's core physics engine and massively upgrades the Developer Experience (DX). By eliminating extreme-scale float truncation and introducing rigorous property-based parity benchmarks, Phaethon now guarantees absolute mathematical precision from quantum levels to astronomical masses.
Core Physics & Precision
- fix(engine): Eradicated the default
prec=9float truncation from the core_PhaethonEngine. The physics engine now retains absolute nativefloat64precision during internal calculations. This resolves a critical underflow vulnerability where microscopic quantum values (e.g.,eVto Joules) or astronomical scales were incorrectly truncated to0.0. - fix(mass): Resolved semantic unit collisions in the mass dimension. Corrected the symbol for Planck Mass from the standard proton notation (
m_p) to the correct scientific notation (m_P), and purged the"gr"alias from theGramregistry to prevent namespace conflicts with theGrainunit.
Enterprise Developer Experience (DX)
- feat(typing): Upgraded the core registry (
registry.py) with strictType['BaseUnit']forward references and@overloadtyping paradigms for methods likeunitsin(). This unlocks full IDE autocomplete (IntelliSense) for dynamically resolved unit classes, massively accelerating developer workflows and reducing runtime typing errors.
Benchmarks & Parity Validation
- test(benchmarks): Engineered and deployed a robust property-based testing suite (
benchmarks/test_pint_parity.py) utilizing thehypothesisframework. Phaethon has now empirically proven 100% mathematical parity against the industry-standardPintlibrary across 300+ randomized extreme-value cross-conversions, whilst successfully parsing 65+ specialized units that Pint natively fails to process due to string hyphenation bugs.
Release Notes 0.2.2 - Architectural Cleansing & Trusted Deployment
Following the Grand Pivot, this release focuses on deep architectural hygiene, entirely purging legacy references from the codebase, and modernizing the DevOps pipeline. Phaethon now boasts a fully automated, military-grade CI/CD publishing system.
Core Architecture Refactoring
- refactor(core): Conducted a deep codebase sweep to eradicate all legacy "Chisa" zombie references. Renamed internal engine classes (e.g.,
ChisaEngineis nowPhaethonEngine) and updated all docstrings and internal logging mechanisms to reflect the new identity. - fix(imports): Standardized all internal and external example scripts to strictly utilize the
import phaethon as ptnconvention, eliminating any lingeringModuleNotFoundErrorissues from the pivot.
Ecosystem & CI/CD Automation
- ci(actions): Engineered a fully automated Continuous Deployment (CD) pipeline using GitHub Actions (
publish.yml). - sec(oidc): Integrated PyPI Trusted Publishing (OIDC). Phaethon deployments are now completely passwordless and tokenless, eliminating secret-leak vulnerabilities and ensuring that only tagged GitHub Releases can securely trigger PyPI package generation.
Documentation Polish
- docs(readme): Completely overhauled the primary
README.mdand theadvanced_physics.mddocumentation to feature the new namespace. - docs(examples): Renamed and refactored the entire interactive tutorial suite. Google Colab notebooks (now
T01_Phaethon_Fundamentals.ipynbandT02_Phaethon_RealWorld_Workflow.ipynb) have been updated to ensure new users can seamlessly test the framework without local installation breaking.
Release Notes 0.2.1 - The Grand Pivot (Renamed to Phaethon)
This release marks a monumental architectural pivot. The project has officially transitioned from its legacy identity ("Chisa") to Phaethon. This rebrand definitively aligns the framework with its true purpose: taming massive, fast-moving Data Engineering pipelines with strict, logic-driven physical axioms.
The Namespace Takeover
- chore(rebrand): The package has been globally renamed to
phaethonon PyPI. The legacychisapackage has been deprecated. All current and future development, including the vectorization engine and declarative schemas, will exclusively continue under the Phaethon namespace. - feat(alias): Established
ptnas the official, standardized import alias (e.g.,import phaethon as ptn). This explicitly prevents namespace collisions and ensures rapid, phonetic developer typing without overlapping with existing tools like PyTorch (pt) or Matplotlib (plt).
Core Engine Continuity
- refactor(migration): Successfully migrated 100% of the core Axiom Engine, Metaclass Algebra, and Vectorization logic from the v0.2.0 build into the new Phaethon core. All DataFrame normalization speeds (~0.046 seconds per 100k rows) remain perfectly intact.
Release Notes 0.2.0 - Declarative Schemas & Unit-Safe Data Pipelines
This major release officially evolves Chisa into a Unit-Safe Data Pipeline Schema, introducing declarative validation for Pandas DataFrames, unparalleled error intelligence, and pure object-oriented Metaclass Algebra.
Declarative Data Schemas
- feat(schema): Introduced
chisa.Schemaandchisa.Fieldfor strict, declarative data normalization.- Allows Data Engineers to ingest messy, heterogeneous Pandas DataFrames and convert them into clean, dimensionally-validated datasets natively.
- feat(integration): Officially elevated Pandas (
pandas>=2.0.0) to a core dependency alongside NumPy, unlocking native vectorized Boolean masking and high-speed schema execution. - feat(schema): Added smart metadata management with
keep_unmapped=Trueanddrop_raw=Trueto seamlessly drop dirty columns while preserving vital pipeline tracking IDs. - feat(schema): Implemented Lifecycle Hooks (
@cs.pre_normalizeand@cs.post_normalize) allowing developers to inject custom domain logic directly into the validation flow. - feat(parsing): Massively expanded unit
aliasesacross all dimensions to supercharge theparse_string=Truemethod, allowing Chisa to autonomously capture and standardize highly irregular textual data.
Smart Error Intelligence
- feat(exceptions): Introduced
NormalizationError. Data pipelines no longer just crash silently. Whenon_error='raise'is triggered, Chisa now provides unparalleled Developer Experience (DX) by printing pinpoint debugging context:- Exact index of the failure.
- Expected physical dimension vs. received anomaly.
- Snippet of the raw dirty string.
- Actionable suggestions to fix the data or adjust schema rules.
The Axiom Engine & Self-Learning Registry
- feat(metaclass): Introduced direct Object-Oriented Metaclass Algebra. Users can now synthesize physical laws by directly dividing/multiplying classes (e.g.,
@axiom.derive(u.Kilogram / u.KilowattHour)). - feat(registry): Implemented a "Self-Learning" DNA injection mechanism. The
UnitRegistrynow dynamically listens to__init_subclass__and autonomously registers new dimensional signatures and custom aliases at runtime.- Impact: Custom dimensions (like ESG Carbon Metrics) synthesized in scripts are instantly recognized by
Schema.normalize().
- Impact: Custom dimensions (like ESG Carbon Metrics) synthesized in scripts are instantly recognized by
Fluent API Flexibility
- fix(fluent): Patched a logic trap in the
convert()engine's internal_compute()method.- The Fluent API can now seamlessly handle all four permutations of input targets without crashing: String-to-String (
'km' -> 'm'), Class-to-String (u.Kilometer -> 'm'), String-to-Class ('km' -> u.Meter), and Class-to-Class (u.Kilometer -> u.Meter).
- The Fluent API can now seamlessly handle all four permutations of input targets without crashing: String-to-String (
Documentation Overhaul
- docs(readme): Completely restructured the documentation architecture.
- The main
README.mdis now strictly focused on Data Engineering (Schemas, Pipeline Hooks, Vectorization, and Pandas integration). Deep-dive scientific computing features have been cleanly migrated todocs/advanced_physics.md.
- The main
- docs(examples): Completely overhauled the
examples/directory with 14 brutal, real-world Data Engineering scripts (e.g., Cloud Compute Billing, ESG Carbon Tracking, Sensor Drift Neutralization). - docs(notebooks): Re-architected the interactive Google Colab notebooks.
T01covers core fundamentals/Schemas, whileT02provides a masterclass on cleaning a dirty IoT Pandas pipeline, complete with Matplotlib visualizations.
Release Notes 0.1.1 - Type Safety Hotfix & Ecosystem Integration
This patch focuses on strictly enforcing cross-library data compatibility and expanding the documentation with real-world Data Science workflows.
Core Engine & Type Safety (Hotfix)
- fix(core): Standardized native Python
float(C-levelfloat64) as the absolute default for all scalar outputs.- Resolves an inconsistency where scalars could be auto-casted to integers or Decimals, preventing unexpected
TypeErrorcrashes when integrating with external ML libraries (e.g., SciPy, Scikit-Learn).
- Resolves an inconsistency where scalars could be auto-casted to integers or Decimals, preventing unexpected
- fix(fluent): Removed the redundant
exactformat option from the Fluent API's.use(format=...)method.- Decimal extraction is now strictly explicitly opt-in. Users must initialize with a
Decimalobject (e.g.,Meter(Decimal('10'))) or use.use(mode='decimal')to trigger audit-level precision.
- Decimal extraction is now strictly explicitly opt-in. Users must initialize with a
Documentation & Ecosystem
- docs(examples): Added a comprehensive suite of 15 standalone Python scripts in the
examples/directory demonstrating the full capability of the Axiom Engine, Custom Domains, and Error Handling. - docs(notebooks): Introduced interactive Jupyter Notebooks (
T01_Chisa_Fundamentals.ipynbandT02_Chisa_RealWorld_Workflow.ipynb) with direct Google Colab integration for seamless onboarding. - feat(integration): Validated and documented zero-bottleneck integration patterns with the broader Data Science ecosystem, including Pandas, Matplotlib, SciPy, SymPy, and Scikit-Learn.