Skip to main content

IO adapter registry and format backends for the Jarvis ecosystem

Project description

Jarvis-Portal

Jarvis-Portal is the standalone IO adapter and registry package for the Jarvis ecosystem.

It provides format-specific read/write behavior for scientific file formats used by Jarvis-HEP and related tools. The currently exposed format is JSON; SLHA, xSLHA, and future HEP calculator formats can be developed behind the registry until they are tested.

Jarvis-Portal is intended to serve YAML-driven Jarvis workflows through Jarvis-HEP. It does not own Jarvis-HEP YAML parsing or runtime workflow semantics.

Scope

Jarvis-Portal owns:

  • format adapter registration and lookup
  • JSON nested entry reads/writes
  • future adapters for ROOT, HepMC, LHE, YODA, SPheno, MadGraph cards, and related HEP formats

Jarvis-HEP owns:

  • YAML IO block parsing
  • runtime path markers such as &J, @PackID, @SampleID, and @Sdir
  • expression evaluation
  • sample/runtime context
  • save/copy/archive policy
  • logger and IO manager integration
  • deciding which variables are written or read
  • plain file copy/save helpers that do not require format parsing

Quick Install

pip install Jarvis-HEP-Portal

Optional format extras:

pip install "Jarvis-HEP-Portal[slha]"
pip install "Jarvis-HEP-Portal[xslha]"
pip install "Jarvis-HEP-Portal[all]"

Development

python -m pip install -e ".[dev,all]"
python -m pytest
ruff check .
python -m build

Basic Usage

CLI:

jportal file
jportal man
jportal man json
jportal -h
jportal -v

jportal file is the only supported business CLI shape. It prints the observable dictionary itself as JSON. Utility exceptions are jportal man, jportal man <format>, -h/--help, and -v/--version.

Python:

from jarvis_portal import IOContext, create_default_registry

registry = create_default_registry()
adapter = registry.get("JSON", "input")

def evaluate_expression(expression, values):
    if expression == "x * 2":
        return values["x"] * 2
    raise ValueError(expression)

context = IOContext(evaluate_expression=evaluate_expression)
observables = await adapter.write_input(
    context,
    {
        "name": "params",
        "path": "input.json",
        "type": "JSON",
        "actions": [
            {
                "type": "Dump",
                "variables": [
                    {"name": "nested", "entry": "config.value", "expression": "x * 2"},
                ],
            },
        ],
    },
    {"x": 1.0},
)

JSON adapter calls return the observable dictionary itself. For JSON input, plain dumped variables are written to the file; expression variables and saved file specs may contribute observables, matching Jarvis-HEP.

Documentation

Status

This package is in alpha development. Runtime behavior should stay small and adapter-focused so Jarvis-HEP can remain the owner of workflow semantics.

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

jarvis_hep_portal-1.2.1.tar.gz (47.5 kB view details)

Uploaded Source

Built Distribution

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

jarvis_hep_portal-1.2.1-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file jarvis_hep_portal-1.2.1.tar.gz.

File metadata

  • Download URL: jarvis_hep_portal-1.2.1.tar.gz
  • Upload date:
  • Size: 47.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for jarvis_hep_portal-1.2.1.tar.gz
Algorithm Hash digest
SHA256 ad0380c414f76e8ce96427b8aa44c0eddd47962b4ba46bdf6bf804841d4b6404
MD5 ee589a6a0da5845c5abbbfda6f16b1b0
BLAKE2b-256 28138cc06a3f1145148a8fb3b8765609571ebdc12d2dcd6357a1955daeba6ef7

See more details on using hashes here.

File details

Details for the file jarvis_hep_portal-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for jarvis_hep_portal-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4b1cda678a46adf6b4dc83fc1e5f75cfb5f3bf405f69dabe3852e091fc4f8604
MD5 7adaeedc543d3cfb375091a42d07b4bf
BLAKE2b-256 4253e339f2608990944e2dc16250d2effecc9b97d0b68ac41ef64d7c98ce9d45

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