Skip to main content

XeDocs manages tracking versioned detector numbers, replacing CMT and ideally all hard-coded values. XeDocs both looks up data from its own online database, and uses straxen URL-style lookup to find other resources. To upload data to the XeDocs database, you must submit it as a PR to https://github.com/XENONnT/corrections

What does Xedocs give you

Data reading

  • Read data from multiple formats (e.g. mongodb, pandas) and locations with a simple unified interface.

  • Custom logic implemented on the document class, e.g. creating a tensorflow model from the data etc.

  • Multiple APIs for reading data, fun functional, ODM style, pandas and xarray.

  • Read data as objects, dataframes, dicts, json.

Writing data

  • Write data to multiple storage backends with the same interface

  • Custom per-collection rules for data insertion, deletion and updating.

  • Schema validation and type coercion so storage has uniform and consistent data.

Other

  • Custom panel widgets for graphical representation of data, web client

  • Auto-generated API server and client + openapi documentation

  • CLI for viewing and downloading data

Basic Usage

Explore the available schemas

import xedocs

>>> xedocs.list_schemas()
>>> ['detector_numbers',
    'fax_configs',
    'plugin_lineages',
    'context_lineages',
    'pmt_area_to_pes',
    'global_versions',
    'electron_drift_velocities',
    ...]

>>> xedocs.help('pmt_area_to_pes')

>>>
        Schema name: pmt_area_to_pes
        Index fields: ['version', 'time', 'detector', 'pmt']
        Column fields: ['created_date', 'comments', 'value']

Read/write data from the shared development database, this database is writable from the default analysis username/password

import xedocs

db = xedocs.development_db()

docs = db.pmt_area_to_pes.find_docs(version='v1', pmt=[1,2,3,5], time='2021-01-01T00:00:00', detector='tpc')
to_pes = [doc.value for doc in docs]

# passing a run_id will attempt to fetch the center time of that run from the runs db
doc = db.pmt_area_to_pes.find_one(version='v1', pmt=1, run_id=25000, detector='tpc')
to_pe = doc.value

Read from the straxen processing database, this database is read-only for the default analysis username/password

import xedocs

db = xedocs.straxen_db()

...

Read from the the corrections gitub repository, this database is read-only

import xedocs

db = xedocs.corrections_repo(branch="master")

...

If you cloned the corrections gitub repo to a local folder, this database can be read too

import xedocs

db = xedocs.local_folder(PATH_TO_REPO_FOLDER)

...

Read data from alternative data sources specified by path, e.g csv files which will be loaded by pandas.

from xedocs.schemas import DetectorNumber

g1_doc = DetectorNumber.find_one(datasource='/path/to/file.csv', version='v1', field='g1')
g1_value = g1_doc.value
g1_error = g1_doc.uncertainty

The path can also be a github URL or any other URL supported by fsspec.

from xedocs.schemas import DetectorNumber

g1_doc = DetectorNumber.find_one(
                         datasource='github://org:repo@/path/to/file.csv',
                         version='v1',
                         field='g1')

Supported data sources

  • MongoDB collections

  • TinyDB tables

  • JSON files

  • REST API clients

Please open an issue on rframe if you want support for an additional data format.

If you want a new datasource to be available from a schema class, you can register it to the class:

from xedocs.schemas import DetectorNumber

DetectorNumber.register_datasource('github://org:repo@/path/to/file.csv', name='github_repo')

# The source will now be available under the given name:

g1_doc = DetectorNumber.github_repo.find_one(version='v1', field='g1')

Documentation

Full documentation hosted by Readthedocs

Credits

This package was created with Cookiecutter and the briggySmalls/cookiecutter-pypackage project template.

Metadata

Release files for xedocs 0.2.44

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

Source distribution (sdist)

Source distribution for xedocs 0.2.44
File Size Uploaded Provenance Actions
xedocs-0.2.44.tar.gz 45.2 kB Without provenance Details for xedocs-0.2.44.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xedocs 0.2.44
File Interpreter ABI Platform Actions
xedocs-0.2.44-py3-none-any.whl Python 3 none any Details for xedocs-0.2.44-py3-none-any.whl

Total release size: 115.8 kB

Release files / xedocs-0.2.44.tar.gz

Download URL xedocs-0.2.44.tar.gz
Size 45.2 kB
Tags Source
SHA-256 checksum
How to use checksums
355d4dd3de4cfffb22875bee60acd6a71f31052b7e4073cc60eac68952d27a83
BLAKE2b-256 checksum
How to use checksums
0614f10e0a018eb1455e28217622c138f1a0dd088e3a59a8ad967d6cbeb9b283
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.1 CPython/3.12.1 Linux/6.11.0-1018-azure

Release files / xedocs-0.2.44-py3-none-any.whl

Download URL xedocs-0.2.44-py3-none-any.whl
Size 70.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8e7586f56343aec7a27da9d556bd564596ada6d27a880b3051849a366dca29a
BLAKE2b-256 checksum
How to use checksums
49253e2f8560c84be7194ce35668eb007dcdf02d2230827f766a685fad7144a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.1 CPython/3.12.1 Linux/6.11.0-1018-azure

Security for xedocs 0.2.44

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.44 This release

2 release files No provenance

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