Skip to content

Commit

Permalink
fixie
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Aug 5, 2024
1 parent 301f261 commit e5063d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/notebook/Notebook.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Base.@kwdef mutable struct Notebook
path::String
notebook_id::UUID=uuid1()
topology::NotebookTopology
_cached_topological_order::Union{Nothing,TopologicalOrder}=nothing
_cached_topological_order::TopologicalOrder
_cached_cell_dependencies_source::Union{Nothing,NotebookTopology}=nothing

# buffer will contain all unfetched updates - must be big enough
Expand Down Expand Up @@ -96,10 +96,12 @@ function Notebook(cells::Vector{Cell}, @nospecialize(path::AbstractString), note
(cell.cell_id, cell)
end)
cell_order=map(x -> x.cell_id, cells)
topology = _initial_topology(cells_dict, cell_order)
Notebook(;
cells_dict,
cell_order,
topology=_initial_topology(cells_dict, cell_order),
topology,
_cached_topological_order=topological_order(topology),
path,
notebook_id
)
Expand Down
8 changes: 5 additions & 3 deletions src/notebook/saving and loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,15 @@ function load_notebook_nobackup(@nospecialize(io::IO), @nospecialize(path::Abstr
appeared_cells_dict = filter(collected_cells) do (k, v)
k appeared_order
end
topology = _initial_topology(appeared_cells_dict, appeared_order)

Notebook(;
cells_dict=appeared_cells_dict,
cell_order=appeared_order,
topology=_initial_topology(appeared_cells_dict, appeared_order),
path=path,
nbpkg_ctx=nbpkg_ctx,
topology,
_cached_topological_order=topological_order(topology),
path,
nbpkg_ctx,
nbpkg_installed_versions_cache=nbpkg_cache(nbpkg_ctx),
metadata=notebook_metadata,
)
Expand Down

0 comments on commit e5063d3

Please sign in to comment.