Skip to main content

A Python framework for modeling scientific systems with persistence and composable object capabilities

Project description

Jangada

A Python framework for modeling scientific systems with persistence and composable object capabilities.

Overview

Jangada provides robust infrastructure components for data-intensive scientific applications, emphasizing:

  • Explicit serialization: Descriptor-driven schemas with HDF5 persistence
  • Composable capabilities: Orthogonal mixin classes for identity, metadata, and state
  • Rich terminal output: Template-based formatting with the Rich library
  • System modeling: Hierarchical system/subsystem paradigms with lazy loading

Key Features

Serialization & Persistence

  • SerializableProperty: Descriptors with validation, change tracking, and lazy initialization
  • Serializable: Registry-backed in-memory serialization protocol
  • Persistable: HDF5 persistence layer with lazy dataset loading via ProxyDataset
  • Support for NumPy arrays, Pandas DataFrames, and custom types

Composable Mixins

Six orthogonal capability classes:

  • Identifiable: Globally unique IDs with weak reference registry
  • Taggable: Validated symbolic tags for organization
  • Nameable: Human-readable names with validation
  • Describable: Long-form descriptions
  • Colorable: Canonical color representation (hex format)
  • Activatable: Boolean activation state

Display & Representation

  • Displayable: Abstract base for Rich library integration
  • Representable: Template method pattern for consistent formatting
  • Customizable terminal output with panels, tables, and color

System Modeling

  • System: Container for subsystems with hierarchical organization
  • Namespace management for system/subsystem paradigms
  • Integration with all framework capabilities

Installation

pip install jangada

Quick Start

from jangada import Persistable, SerializableProperty
from jangada.mixin import Identifiable, Nameable, Taggable

class ScientificModel(Persistable, Identifiable, Nameable, Taggable):
    """A simple scientific model with persistence and metadata."""
    
    data = SerializableProperty(default=None)
    parameters = SerializableProperty(default=dict)
    
    def __init__(self, name: str, tag: str):
        self.name = name
        self.tag = tag
        self.parameters = {"learning_rate": 0.01}

# Create and persist
model = ScientificModel(name="Experiment-1", tag="ml_model")
model.save("/path/to/storage.h5")

# Load later
loaded_model = ScientificModel.load("/path/to/storage.h5")
print(f"Loaded {loaded_model.name} with ID {loaded_model.id}")

Design Philosophy

Jangada follows these principles:

  • Modularity: Orthogonal components that work independently
  • Composability: Mix-and-match capabilities via multiple inheritance
  • Explicitness: Clear schemas and configuration over magic
  • Efficiency: Lazy loading for large datasets
  • Quality: Comprehensive documentation, testing, and type hints

Documentation

Full documentation is available at readthedocs.io.

Requirements

  • Python >= 3.10
  • numpy >= 1.20.0
  • pandas >= 1.3.0
  • h5py >= 3.0.0
  • matplotlib >= 3.4.0
  • rich >= 10.0.0

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details.

Author

Rafael - GitHub Profile

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jangada-0.1.8.tar.gz (91.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jangada-0.1.8-py3-none-any.whl (54.5 kB view details)

Uploaded Python 3

File details

Details for the file jangada-0.1.8.tar.gz.

File metadata

  • Download URL: jangada-0.1.8.tar.gz
  • Upload date:
  • Size: 91.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for jangada-0.1.8.tar.gz
Algorithm Hash digest
SHA256 28cb69fe20127c2d84507b3fb3d35a5bbff8ac5329a73379672d8d3286dcaf81
MD5 7ffc234c5ce61be65ec853f3e61d7ae9
BLAKE2b-256 e2a034c19b88b2e112552336e9c8df7c861a9e3537b055903bd0b649e95d69d2

See more details on using hashes here.

File details

Details for the file jangada-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: jangada-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 54.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for jangada-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ed2b81c68f5f5d6baae4d26d008f419aa6fdc8b5c857a12ca0d7f8af5fe066ca
MD5 66d0e175b1f98717b9f3bd1ead00cf38
BLAKE2b-256 fc223579f279dca9a48ff20738b148637415f51c42fe9dcbde64af6743149b3c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page