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

[BUG]: Cannot serialize template model that has datetime in annotations #339

Closed
liunelson opened this issue Jun 26, 2024 · 0 comments · Fixed by #340
Closed

[BUG]: Cannot serialize template model that has datetime in annotations #339

liunelson opened this issue Jun 26, 2024 · 0 comments · Fixed by #340

Comments

@liunelson
Copy link

I created a TemplateModel with annotations. When the annotation fields are time_start, time_end are given datetime strings, the values are converted to datetime objects and the function template_model_to_petrinet_json(...) does not know to convert them back to strings before JSON serialization.

model = TemplateModel(
    ..., 
    annotations = Annotations(
        ...,
        time_start = "2020-03-01T00:00:00",
        time_end = "2020-08-01T00:00:00"
    )
)

with open("./model.json", "w") as f:
    json.dump(template_model_to_petrinet_json(model), f, indent = 4)
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 a pull request may close this issue.

1 participant