GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Serialization · Issue #451 · fastplotlib/fastplotlib

Serialization #451

New issue
Copy link
New issue
Copy link
Open
Open
Serialization#451
Copy link
Assignees
kushalkolar

Description

@kushalkolar
kushalkolar
opened on Mar 27, 2024
Issue body actions

After presenting notebooks with a thesis committee member today I realized that it would be useful to serialize plots to disk so I that I can quickly bring them back up when a Flatiron cluster node decides to end my session 😆 .

GSP is a WIP but I'm thinking of something much simpler, at least for now.

  • Each Graphic implements to_dict() and classmethod from_dict() that stores all the buffers necessary to create the appropriate geometry and material for that Graphic, this can probably be implemented via methods on corresponding GraphicFeatures.
  • Apart from serializing Graphics, I think we just need to store the state of each PlotArea, i.e. cameras, controllers, canvas size.
  • GridPlot holds info for the gridplot configuration and all subplots
  • For ImageWidget we would need to store the entire 2D or 3D movie, so maybe ultimately store things to zarr instead of hdf5. 🤔
  • classmethods on Plot, GridPlot and ImageWidget?
  • Somewhere in the output file store the type of plot that needs to be constructed and the fpl version it was created in. Have a helper function fastplotlib.load_viz() that auto create the right type of plot
  • No animation function support for now

I'll play around with this and note that it's very experimental.

Reacted by Almar Klein

Activity

  1. kushalkolar
    self-assigned this
    on Mar 27, 2024
  2. kushalkolar commented on Apr 13, 2024

    @kushalkolar
    kushalkolar
    on Apr 13, 2024
    MemberAuthor
    More actions

    I just got an idea! We might be able to serialize animation functions and graphic feature callbacks if the objects within the scope of the callback are contained within the figure 🤔

    Example:

    line_graphic = figure[0, 0].add_line(sine, name="sine")
    
    selector = line_graphic.add_linear_region_selector(selection=(0, 10))
    
    hankel = linalg.hankel(sine[selector.selection()])
    img_graphic = figure[1, 0].add_image(hankel, name="hankel")
    
    def position_changed(ev):
      data = ev.pick_info["selected_data"]
      # figure is within the scope of figure, but `linalg` is not....
      figure[1, 0]["hankel"].data = linalg.hankel(data)

    should look into dill to get some ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @kushalkolar
    kushalkolar

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.