Skip to main content

A collection of domain specific IDS components

Project description

Tetra Data Domain-Specific Components Documentation

ts-ids-components is home to domain-specific common components for use in programmatic IDSs. For getting started with programmatic IDS or documentation about creating and using Tetra Data models, see ids.tetrascience.com.

These components can be used in any IDS as a way to build upon existing data models. When multiple IDSs use the same common components, accessing data becomes more consistent by enabling reuse of search queries and application code.

Version

v0.11.2

Install

pip install ts-ids-components

Quickstart

After installing this package, components can be imported and used in any programmatic IDS definition.

Here is an example of a complete IDS definition which uses the {py:class}Filter <ts_ids_components.plate_reader.Filter> component:

from typing import List

from ts_ids_core.schema import (
    IdsElement,
    IdsField,
    Required,
    SchemaExtraMetadataType,
    TetraDataSchema,
)

from ts_ids_components.plate_reader import Filter


class InstrumentMethod(IdsElement):
    """Methods defined for the instrument run"""

    protocol_id: str = IdsField(description="Identifier for the protocol used")
    filter: Filter


class MyPlateReaderModel(TetraDataSchema):
    """IDS demonstrating plate reader components"""

    schema_extra_metadata: SchemaExtraMetadataType = {
        "$id": "https://ids.tetrascience.com/common/plate-reader-component-demo/v1.0.0/schema.json",
        "$schema": "http://json-schema.org/draft-07/schema",
    }

    ids_type: Required[str] = IdsField(
        default="plate-reader-component-demo", alias="@idsType", const=True
    )
    ids_version: Required[str] = IdsField(
        default="v1.0.0", alias="@idsVersion", const=True
    )
    ids_namespace: Required[str] = IdsField(
        default="common", alias="@idsNamespace", const=True
    )

    methods: List[InstrumentMethod]

See {external+ts-ids-core:doc}ts-ids-core export-schema <cli/export_schema> documentation for an explanation of generating JSON Schema from a programmatic IDS.

Expand to show JSON schema for `MyPlateReaderModel`
{
  "description": "IDS demonstrating plate reader components",
  "type": "object",
  "properties": {
    "@idsType": {
      "const": "plate-reader-component-demo",
      "type": "string"
    },
    "@idsVersion": {
      "const": "v1.0.0",
      "type": "string"
    },
    "@idsNamespace": {
      "const": "common",
      "type": "string"
    },
    "@idsConventionVersion": {
      "description": "IDS convention version. Defined by TetraScience.",
      "const": "v1.0.0",
      "type": "string"
    },
    "methods": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/InstrumentMethod"
      }
    }
  },
  "required": [
    "@idsType",
    "@idsVersion",
    "@idsNamespace",
    "@idsConventionVersion"
  ],
  "additionalProperties": false,
  "$id": "https://ids.tetrascience.com/common/plate-reader-component-demo/v1.0.0/schema.json",
  "$schema": "http://json-schema.org/draft-07/schema",
  "definitions": {
    "ValueUnit": {
      "type": "object",
      "properties": {
        "value": {
          "type": [
            "number",
            "null"
          ]
        },
        "unit": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "value",
        "unit"
      ],
      "additionalProperties": false
    },
    "Filter": {
      "description": "Optical filter properties",
      "type": "object",
      "properties": {
        "position": {
          "description": "Position of this filter in a container like a filter wheel",
          "type": [
            "string",
            "null"
          ]
        },
        "bandwidth": {
          "description": "The range of frequencies associated with this filter",
          "$ref": "#/definitions/ValueUnit"
        },
        "wavelength": {
          "description": "Characteristic wavelength of this filter",
          "$ref": "#/definitions/ValueUnit"
        }
      },
      "additionalProperties": false
    },
    "InstrumentMethod": {
      "description": "Methods defined for the instrument run",
      "type": "object",
      "properties": {
        "protocol_id": {
          "description": "Identifier for the protocol used",
          "type": "string"
        },
        "filter": {
          "$ref": "#/definitions/Filter"
        }
      },
      "additionalProperties": false
    }
  }
}

License

License information can be found here: LICENSE.

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

ts_ids_components-0.11.2.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

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

ts_ids_components-0.11.2-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

File details

Details for the file ts_ids_components-0.11.2.tar.gz.

File metadata

  • Download URL: ts_ids_components-0.11.2.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ts_ids_components-0.11.2.tar.gz
Algorithm Hash digest
SHA256 93f700cf80e74c9bc17831ffdc8a1d71353f6ab25bef0c847264809c8c24a72a
MD5 61fcc764d3949c5a41c0aef4af4c3f63
BLAKE2b-256 fcac912c4004abb37785c74cc27b9eea702e72319ba58aba7c9efada691d3e3f

See more details on using hashes here.

File details

Details for the file ts_ids_components-0.11.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ts_ids_components-0.11.2-py3-none-any.whl
Algorithm Hash digest
SHA256 85355fdf5a246b15d76b2199809c32a13fad9d8701dab6622171e2357fae66b4
MD5 e6fb6dc1d7bde046a185b03f3692c02b
BLAKE2b-256 7264f3cfc6e6dcad7908eed7acd93345f983981604b3880e56926ca0ae8c7e5f

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