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

add _Base.additional_properties #34

Merged
merged 1 commit into from
Sep 30, 2024
Merged

add _Base.additional_properties #34

merged 1 commit into from
Sep 30, 2024

Conversation

dsehnal
Copy link
Member

@dsehnal dsehnal commented Sep 29, 2024

@JonStargaryen I've added an easier way to set additional properties which doesn't require supporting it in every single builder function, where you can do something like:

builder.download(url=_url_for_mmcif(id))
        .parse(format="mmcif")
        .model_structure()
        .additional_properties(prop="test")  # sets prop of the parent model to "test"
        .component()
        .additional_properties(prop2="test2")  # sets prop2 of the parent component to "test2"
        .representation()

I wonder if we should make this the default method and remove the additional_properties: AdditionalProperties = None, from the constructor methods?

@dsehnal dsehnal requested a review from sbittrich September 29, 2024 07:40
@dsehnal dsehnal merged commit 3abe0f6 into master Sep 30, 2024
@dsehnal dsehnal deleted the additional-props branch September 30, 2024 15:06
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.

1 participant