Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ispyb

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ispyb

Python package to access ISPyB database

  • 10.2.4
  • PyPI
  • Socket score

Maintainers
1

PyPI version Conda Version Development status Python versions

Build Status Coverage Status Documentation Status Code style: black Language grade: Python Total alerts

ISPyB API

This package provides a way to write acquisition and processing results into an ISPyB database. Currently, the only supported method is through stored procedures, but the package is designed to allow for other methods as well, such as webservices.

Documentation

Please see https://ispyb.readthedocs.io.

Requirements

  • Python 3.7, 3.8, 3.9, 3.10, 3.11
  • The MySQL Connector/Python package.
  • MariaDB 10.0+ or MySQL 5.6+, but we recommend MariaDB 10.2 or later.
  • An ISPyB database installed on the above. See the ispyb-database repository for details.

Installation

From PyPI:

pip install --user ispyb

The --user option installs the package for your own user only. You can leave it out if you want to install the package system-wide.

To install the source code in editable mode for development:

git clone git@github.com:DiamondLightSource/ispyb-api.git
pip install --user -e ispyb-api

Examples

import ispyb
from datetime import datetime

# Get a connection and data area objects
with ispyb.open("config.cfg") as conn:
    core = conn.core
    mx_acquisition = conn.mx_acquisition

    # Find the id for a given visit
    sessionid = core.retrieve_visit_id("cm14451-2")

    # Create a new data collection group entry:
    params = mx_acquisition.get_data_collection_group_params()
    params["parentid"] = sessionid
    params["experimenttype"] = "OSC"
    params["starttime"] = datetime.strptime("2017-09-21 13:00:00", "%Y-%m-%d %H:%M:%S")
    params["endtime"] = datetime.strptime("2017-09-21 13:00:10", "%Y-%m-%d %H:%M:%S")
    params["comments"] = "This is a test of data collection group."
    dcg_id = mx_acquisition.insert_data_collection_group(list(params.values()))
    print("dcg_id: %i" % dcg_id)

See docs/pipeline2ispyb.py for a more detailed example of how to use the package.

Tests

Unit tests (pytests) are run automatically by Azure against a real MariaDB ISPyB database schema. You can also run the tests in your Development environment if you have an ISPyB database.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc