Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 17, 2026

Issue #12 requested JLD2 support for better handling of arbitrary Julia types (e.g., BigInt) that BSON struggles with.

Changes

  • File format detection: Extension-based dispatch (.bson → BSON.jl, .jld2 → JLD2.jl)
  • Metadata handling: BSON uses Symbol keys, JLD2 uses String keys
  • Function updates: Modified cache() to detect extension and call appropriate save/load functions
  • Validation: Early extension checking with clear error messages for unsupported formats
  • Tests: Added 21 tests covering function form, macro form, module loading, and error handling
  • Documentation: Updated docstrings and README with file format examples

Usage

# BSON format (existing)
cache("results.bson") do
    x = compute_expensive_result()
end

# JLD2 format (new)
cache("results.jld2") do
    x = big"123456789012345678901234567890"  # BigInt works better with JLD2
end

Both formats preserve all existing functionality. Macro form @cache works with both extensions automatically.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/FluxML/MacroTools.jl/tarball/1e0228a030642014fe5cfe68c2c0a818f9e3f522
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaCollections/DataStructures.jl/tarball/e357641bb3e0638d353c4b29ea0e40ea644066a6
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaCollections/OrderedCollections.jl/tarball/05868e21324cede2207c6f0f466b4bfef6d5e7ee
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaCollections/SortingAlgorithms.jl/tarball/64d974c2e6fdf07f8155b5b2ca2ffa9069b608d9
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/DataAPI.jl/tarball/abe83f3a2f1b857aac70ef8b269080af17764bbe
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/DataFrames.jl/tarball/d8928e9169ff76c6281f39a659f9bca3a573f24c
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/InvertedIndices.jl/tarball/6da3c4316095de0f5ee2ebd875df8721e7e0bdbe
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/Missings.jl/tarball/ec4f7fbeab05d7747bdf98eb74d130a2a2ed298d
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/PooledArrays.jl/tarball/36d8b4b899628fb92c2749eb488d884a926614d3
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/SentinelArrays.jl/tarball/ebe7e59b37c400f694f52b58c93d26201387da70
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaData/Tables.jl/tarball/f2c1efbc8f3a609aadf318094f8fc5204bdaf344
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaIO/BSON.jl/tarball/4c3e506685c527ac6a54ccc0c8c76fd6f91b42fb
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaIO/FileIO.jl/tarball/d60eb76f37d7e5a40cc2e7c36974d864b82dc802
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaIO/JLD2.jl/tarball/d97791feefda45729613fafeccc4fbef3f539151
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaIO/TranscodingStreams.jl/tarball/0c45878dcfdcfa8480052b6ab162cdd138781742
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaLang/Compat.jl/tarball/9d8a54ce4b17aa5bdce0ea5c34bc5e7c340d16ad
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaLang/PrecompileTools.jl/tarball/07a921781cab75691315adc645096ed5e370cb77
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaLang/ScopedValues.jl/tarball/c3b2323466378a2ba15bea4b2f73b081e022f473
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaPackaging/Preferences.jl/tarball/522f093a29b31a93e34eaea17ba055d850edea28
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaPackaging/Requires.jl/tarball/62389eeff14780bfe55195b7204c0d8738436d64
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaPluto/ExpressionExplorer.jl/tarball/4a8c0a9eebf807ac42f0f6de758e60a20be25ffb
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • https://api.github.com/repos/JuliaStats/Statistics.jl/tarball/ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaStrings/InlineStrings.jl/tarball/8f3d257792a522b4601c24a577954b0a8cd7334d
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/JuliaStrings/LaTeXStrings.jl/tarball/dda21b8cbd6a6c40d9d02a73230f9d70fed6918c
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/KristofferC/Crayons.jl/tarball/249fe38abf76d48563e2f4556bebd215aa317e15
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/julia-vscode/TestItemRunner.jl/tarball/76f275a3f3d83ece88ec69d73058048de5acb1dc
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/julia-vscode/TestItems.jl/tarball/42fd9023fef18b9b78c8343a4e2f3813ffbcefcb
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/queryverse/DataValueInterfaces.jl/tarball/bfc1187b79289637fa0ef6d4436ebdfe6905cbd6
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/queryverse/IteratorInterfaceExtensions.jl/tarball/a3f24677c21f5bbe9d2a714f95dcd58337fb2856
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/queryverse/TableTraits.jl/tarball/c06b2f539df1c6efa794486abfb6ed2022561a39
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/ronisbr/PrettyTables.jl/tarball/c5a07210bd060d6a8491b0ccdee2fa0235fc00bf
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/ronisbr/StringManipulation.jl/tarball/a3c1536470bf8c5e02096ad4853606d7c8f62721
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/simonster/Reexport.jl/tarball/45e428421666073eab6f2da5c9d310d99bb12f9b
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (http block)
  • https://api.github.com/repos/vchuravy/HashArrayMappedTries.jl/tarball/2eaa69a7cab70a52b9687c8bf950a5a93ec895ae
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() (http block)
  • pkg.julialang.org
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.instantiate() (dns block)
    • Triggering command: /usr/bin/julia julia --project=. -e using Pkg; Pkg.test() (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Please open a new PR to address #12. The PR should involve minimal changes to the code, only modifying how the saving/loading is done. Make sure to add some corresponding tests to exercise the new code.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 5 commits January 17, 2026 04:03
Co-authored-by: dahong67 <9384655+dahong67@users.noreply.github.com>
Co-authored-by: dahong67 <9384655+dahong67@users.noreply.github.com>
Co-authored-by: dahong67 <9384655+dahong67@users.noreply.github.com>
Co-authored-by: dahong67 <9384655+dahong67@users.noreply.github.com>
Co-authored-by: dahong67 <9384655+dahong67@users.noreply.github.com>
Copilot AI changed the title [WIP] Update saving and loading methods with tests Add JLD2 file format support Jan 17, 2026
Copilot AI requested a review from dahong67 January 17, 2026 04:15
@codecov
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5b86c69) to head (80e5968).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #26   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           40        57   +17     
=========================================
+ Hits            40        57   +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dahong67 dahong67 marked this pull request as ready for review January 17, 2026 06:09
Copy link
Owner

@dahong67 dahong67 left a comment

Choose a reason for hiding this comment

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

Revised and looking good. Ready to merge!

@dahong67 dahong67 merged commit 9ad7299 into master Jan 17, 2026
8 of 9 checks passed
@dahong67 dahong67 mentioned this pull request Jan 17, 2026
@dahong67 dahong67 deleted the copilot/update-saving-loading-process branch January 17, 2026 06:22
dahong67 referenced this pull request Jan 17, 2026
Set compat for BSON and drop bson_mod
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