Skip to main content

Extra utility functions for X-Midas.

Project description

xmextras

Extra helper functionality for X-Midas.

XMSessionContext

Wraps an XMSession in with a context manager to ensure it gets ended correctly when exiting.

import xmextras as xmx

with xmx.XMSessionContext() as session:
    session.xm('res answer 42')

    # or
    from pymidas.xmidas import xm
    xm.res('answer', 42)

    answer = session.xmpy.res['answer']

info

Returns a dictionary of information about the X-Midas instance, which can be useful for tagging metrics and benchmarks for comparison.

import xmextras as xmx

with xmx.XMSessionContext() as session:
    info = xmx.info(session)  # also works with a normal XMSession instance

J1950

Conversion functions for dealing with J1950 times (seconds since January 1, 1950).

dt = j1950_to_datetime(2191001400.0)
j = datetime_to_j1950(dt)
e = j1950_to_epoch(2191001400.0)
j = epoch_to_to_j1950(1559849400.0)

bluefile

xmextras locates the system installation of bluefile.py so it can be imported outside of an X-Midas environment.

from xmextras import bluefile
header = bluefile.readheader('some_bluefile.tmp')

mcrlint

The mcrlint command is also included as part of xmextras. It can be used for linting X-Midas macro code. Use mcrlint --help for more information.

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

xmextras-2024.185.1151.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

xmextras-2024.185.1151-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file xmextras-2024.185.1151.tar.gz.

File metadata

  • Download URL: xmextras-2024.185.1151.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for xmextras-2024.185.1151.tar.gz
Algorithm Hash digest
SHA256 980a41a1cf306798fc393ea7f7a057964208ef8a3514d990be76687bc05b08ab
MD5 61b12de52f13770ad5e6b7bcbe9c48f2
BLAKE2b-256 43d1d43b75d55f6cf37649c5faad7fc220df4938bdb8ce2a10b107b9e64ed597

See more details on using hashes here.

File details

Details for the file xmextras-2024.185.1151-py3-none-any.whl.

File metadata

File hashes

Hashes for xmextras-2024.185.1151-py3-none-any.whl
Algorithm Hash digest
SHA256 962e96a2d81f7f7d5088c9df837001efe2ce4ce71b781820816e06950566fc14
MD5 6c44d29234f85e91a095a331b2104038
BLAKE2b-256 9e140b83c62a2eefc11996b2ff72d985729a2f41b423591110c0b13efa6c4be5

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