Skip to content

Add deserialisation capabilities for raw JSON#184

Closed
BenCurran98 wants to merge 2 commits into
KristofferC:masterfrom
BenCurran98:master
Closed

Add deserialisation capabilities for raw JSON#184
BenCurran98 wants to merge 2 commits into
KristofferC:masterfrom
BenCurran98:master

Conversation

@BenCurran98

@BenCurran98 BenCurran98 commented Jan 14, 2025

Copy link
Copy Markdown
Contributor

Hi, I've had a go at adding some deserialisation capabilities for the current simple JSON functionality we have (with the todict function). Ideally something like #136 (particularly the suggestion to use StructTypes and JSON3)would be much nicer to have, but this might do in the interim?

Comment thread src/show.jl
t₁, b₁ = time_ns(), gc_bytes()
Δt, Δb = t₁ - t₀, b₁ - b₀
# make sure the deltas we report actually match the time elapsed - can cause problems if we go back to look at results at a later time
Δt, Δb = totmeasured(to)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this in since I found if I deserialised a TimerOutput that I ran several hours ago, it showed the "total time" as being e.g. 7 hours, when the actual time was only 400 seconds. This way, the delta remains unaffected by time elapsed since the operation was run

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pulled this out into a specific fix here #187

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was actually reverted. The behavior is intentional in some uses of this package

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.

2 participants