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

Introduce a Handler hierarchy and DictHandler #50

Merged
merged 2 commits into from
Feb 16, 2023
Merged

Conversation

rofinn
Copy link
Member

@rofinn rofinn commented Feb 14, 2023

As mentioned in #49

  • Create an AbstractHandler type
  • Deprecate Handler to JLSOHandler
  • Introduce DictHandler which just stores objects in a shared Dict{String, Dict{Symbol, Any}} (vs individual JLSOFiles on disk).
  • Loosen existing stage vs commit methods to support both handler options
  • Include tests for each of the call-site examples in testpkg.jl

Out-of-scope:

  • Generalising the Handler to a FileHandler (the JLSO API is too ingrained)
  • Simplifying the stage vs commit behaviour (would require a more significant change to multiple places in the codebase)
  • Including any kind of serialization logic to the DictHandler... it's just a field you access
  • Support for writing to multiple handlers with the same checkpoint

@codecov
Copy link

codecov bot commented Feb 14, 2023

Codecov Report

Merging #50 (27e02eb) into main (ee797f5) will decrease coverage by 0.12%.
The diff coverage is 94.44%.

@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
- Coverage   96.42%   96.31%   -0.12%     
==========================================
  Files           5        5              
  Lines         168      190      +22     
==========================================
+ Hits          162      183      +21     
- Misses          6        7       +1     
Impacted Files Coverage Δ
src/deprecated.jl 100.00% <ø> (ø)
src/Checkpoints.jl 94.33% <80.00%> (ø)
src/handler.jl 95.83% <94.11%> (-1.14%) ⬇️
src/session.jl 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@rofinn rofinn requested a review from morris25 February 14, 2023 20:35
Copy link
Member

@morris25 morris25 left a comment

Choose a reason for hiding this comment

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

LGTM!

src/handler.jl Outdated Show resolved Hide resolved
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