Skip to main content

Simularium Metrics Calculator

Build Status Documentation

Calculate plot metrics from spatial agent data


Installation

Stable Release: pip install simularium-metrics-calculator
Development Head: pip install git+https://github.com/simularium/metrics-calculator.git

To install in editable mode with all dev dependencies: just install

Quickstart

from simulariumio import FileConverter, InputFileData
from simularium_metrics_calculator import (
    PLOT_TYPE,
    SCATTER_PLOT_MODE,
    MetricsService,
    PlotInfo,
)

# create main class
metrics_service = MetricsService()

# check the metrics that are available to plot
metrics = metrics_service.available_metrics()

# load simularium trajectory data using simulariumio
traj_data = FileConverter(
    input_file=InputFileData(
        file_path=(
            "simularium_metrics_calculator/tests/data/"
            "aster_pull3D_couples_actin_solid_3_frames_small.json"
        )
    )
)._data

# configure some plots
plot1 = PlotInfo(  # Number of agents vs time scatterplot
    plot_type=PLOT_TYPE.SCATTER,
    metric_info_x=metrics[0]["uid"],
    metric_info_y=metrics[2]["uid"],
    scatter_plot_mode=SCATTER_PLOT_MODE.LINES,
)
plot2 = PlotInfo(  # Nearest neighbor distance histogram
    plot_type=PLOT_TYPE.HISTOGRAM,
    metric_info_x=metrics[3]["uid"],
)

# calculate the plot data
result = manager.plot_data(
    traj_data,
    plots=[
        plot1,
        plot2,
    ],
)

Documentation

For full package documentation please visit simularium.github.io/metrics-calculator.

Development

See CONTRIBUTING.md for information related to developing the code.

Apache Software License 2.0

Metadata

Release files for simularium-metrics-calculator 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simularium-metrics-calculator 1.0.2
File Size Uploaded
simularium_metrics_calculator-1.0.2.tar.gz 27.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simularium-metrics-calculator 1.0.2
File Interpreter ABI Platform
simularium_metrics_calculator-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 55.4 kB

Release files / simularium_metrics_calculator-1.0.2.tar.gz

Download URL simularium_metrics_calculator-1.0.2.tar.gz
Size 27.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4b1d26bcbc597d9b91395cb70dab718bc4f5ebedb280d524b9879dc6aaa1ed96
BLAKE2b-256 checksum
How to use checksums
02ae85ff119abd9a12dab2b95884acb0396f5dc225e85292c35ffbf9f0b672b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release files / simularium_metrics_calculator-1.0.2-py3-none-any.whl

Download URL simularium_metrics_calculator-1.0.2-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4d56c49992a1ed28d69f2560f79ae275707448a52f304f5f15b15845337ef8d
BLAKE2b-256 checksum
How to use checksums
1a08b51c65cb7af2f9e9c1f8a2412240b89f78cf1361437435a870653d393f96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page