Skip to main content

CI Coverage PyPI License

ppmac_macro_substitution

A script that substitutes macros in template files.

Gets substitutes and template files and uses them to generate files (primarily kinematics). Default location of template files: configure/coord_templates.

The generated files are put in destination_folder which defaults to configure/coord_substitution.

Naming convention for generated kinematics:

    cs_<coordinate_system_number>_<name_of_template_file>

and for other files:

    tmp_<name_of_template_file>
Source https://github.com/DiamondLightSource/ppmac-macro-substitution
PyPI pip install ppmac-macro-substitution
Releases https://github.com/DiamondLightSource/ppmac-macro-substitution/releases

To print the version of the script you can do:

from ppmac_macro_substitution import __version__

print(f"Hello ppmac_macro_substitution {__version__}")

An example substitution file for 3 jack kinematic template:

from ppmac_macro_substitution import generate

substitutes = {}
substitutes["$(COORD)"] = "4"
substitutes["$(J1)"] = "1"
substitutes["$(J1X)"] = "20"
substitutes["$(J1Z)"] = "10"
substitutes["$(J2)"] = "2"
substitutes["$(J2X)"] = "12"
substitutes["$(J2Z)"] = "13"
substitutes["$(J3)"] = "3"
substitutes["$(J3X)"] = "15"
substitutes["$(J3Z)"] = "16"
substitutes["$(MD)"] = "10"
substitutes["$(MCX)"] = "100"
substitutes["$(MCZ)"] = "2"

kinematic_template_files = ["inv_3jack.kin", "fwd_3jack.kin"]

generate(
    substitutes,
    kinematic_template_files,
)

In order to generate the kinematics using default template folder and the default destination folder run the script in the folder above the configure folder.

Metadata

Release files for ppmac-macro-substitution 1.0.1

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

Source distribution (sdist)

Source distribution for ppmac-macro-substitution 1.0.1
File Size Uploaded Provenance
ppmac_macro_substitution-1.0.1.tar.gz 26.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ppmac-macro-substitution 1.0.1
File Interpreter ABI Platform
ppmac_macro_substitution-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 38.9 kB

Release files / ppmac_macro_substitution-1.0.1.tar.gz

Download URL ppmac_macro_substitution-1.0.1.tar.gz
Size 26.1 kB
Tags Source
SHA-256 checksum
How to use checksums
60f686a027381c566d04cc3c617ae3c1e83661a8f80afbbc7e5db86e51bd02a5
BLAKE2b-256 checksum
How to use checksums
376304104674d63907d44c699a64171b146a553299253108e7802bc6b5dade35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / ppmac_macro_substitution-1.0.1-py3-none-any.whl

Download URL ppmac_macro_substitution-1.0.1-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f572283a95645cae8a676cecc34297a1856a3854277ee49d58f7bc20efc25a58
BLAKE2b-256 checksum
How to use checksums
5dd41dba4cb96daac9827246325092c8d2973bd19deedc3a958335c0787f622f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Security for ppmac-macro-substitution 1.0.1

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.

Release history Release notifications | RSS feed

This release

1.0.1 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