Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOI 2.22.23 Add metaspec builder functions #17

Merged
merged 14 commits into from
May 20, 2024
Merged

Conversation

reweeden
Copy link
Contributor

These helper functions make it simpler to create the metaspec file by encapsulating some of the boilerplate JSON structure and adding ability to use python operators to generate arithmetic directives.

TEMPLATE = build({
    "key": mapped("source", "some.key") + mapped("source", "some.other.key")
})

Is equivalent to writing

TEMPLATE = {
    "key": {
        "@add": {
            "left": {
                "@mapped": {
                    "source": "source",
                    "key": "some.key",
                },
            },
            "right": {
                "@mapped": {
                    "source": "source",
                    "key": "some.other.key",
                },
            },
        },
    },
}

@reweeden reweeden force-pushed the rew/metaspec-builder branch 2 times, most recently from 0cb6097 to 26e8680 Compare May 6, 2024 18:53
@reweeden reweeden requested review from mattp0, mckadesorensen and gjclark and removed request for mattp0, mckadesorensen and gjclark May 6, 2024 18:56
@reweeden reweeden force-pushed the rew/metaspec-builder branch from 26e8680 to 1967208 Compare May 7, 2024 16:39
@reweeden reweeden requested a review from mckadesorensen May 7, 2024 16:44
@reweeden reweeden force-pushed the rew/metaspec-builder branch from 1967208 to d002c69 Compare May 7, 2024 19:58
@reweeden reweeden requested a review from mckadesorensen May 7, 2024 19:59
@reweeden reweeden merged commit e31dbea into main May 20, 2024
6 checks passed
@reweeden reweeden deleted the rew/metaspec-builder branch May 20, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants