Jupyter integration
Execute Aner notebooks with a registered native kernel, persistent sessions, development observations, and explicit reset and error contracts.
ImplementedBegin with the aner.dev overview for the module API and runnable entry point.
Aner executes .ipynb notebooks through a registered Aner kernel and the native interpreter. This reference describes a configured notebook environment. Kernel registration and interpreter installation are separate deployment prerequisites.
Requirements
- A notebook application with a registered Aner kernel.
- An updated native
anerexecutable supporting persistent sessions and development observations. - An accessible working directory containing any input files referenced by the notebook.
The kernel configuration identifies the native executable. Execution uses the configured path; if no path is configured, the integration checks ANER_EXECUTABLE and then the aner command on PATH. This reference does not imply that the kernel is included in every binary package.
Execution
Select Aner from the notebook application's kernel selector. Open the development notebook or the neural research notebook. Code cells contain Aner source; Markdown cells contain authored document text.
Imports, functions, classes, and typed variables persist between successful cells. Restart or reset the kernel before redefining a retained function or class. A static error preserves earlier state. A runtime error or transport failure clears native state; rerun the required setup cells.
Interactive 3D plots
Open the synthetic Boulder 3D .ipynb or the trajectory and gridded surface .ipynb and select Aner with the matching updated native runtime and kernel adapter. Both retain byte identical analysis cells with their .anernb counterpart and the analysis prefix of their .aner source. The Boulder notebook requires the local CSV while constructing its chart; the trajectory and surface examples need no data file. No map packs are required.
scatter3d(x, y, z, values) encodes an independent fourth scalar through color; line3d connects supplied XYZ samples and surface3d joins an explicit rectangular grid. The Boulder notebook uses an explicit aner.data schema and bounded complete collection, then plot.scatter3d_frames_table(table) for six captures of 63 stable observations. The 378 CSV rows identify each observation by time label and site ID; later frames deliberately shuffle rows. First seen time and global site order are authoritative, and site IDs align records even when coordinates move. Site IDs are not displayed by the current spatial inspector. Duplicate or absent time/site pairs and missing required cells reject rather than becoming zeros. Drag inside the plot with the mouse to orbit, or use Rotate plot X/Y/Z degree fields and ±15° buttons to turn each axis. Reset/Home restore source authored camera/XYZ/zoom while retaining frame and inspection state; XY/XZ/YZ clear XYZ offsets for plane views. Axis turns act on the scale normalized plot in fixed X then Y then Z order, before camera orbit. They do not edit raw coordinates. A time slider, previous/next and Play/Pause controls run locally alongside zoom and exact value inspection. Frame changes preserve axis rotations and selection; manual rotation pauses playback. Spatial HTML uses an opaque origin iframe with local scripts, blob image rendering and user triggered downloads enabled while external connections remain disabled, while the initial native SVG stays available under frontend trust restrictions. Camera changes preserve the values and color domain and do not contact the kernel.
Run aner run examples/plot_boulder_3d.aner from the writable project root containing examples/fixtures/plot_boulder_3d_frames.csv, or run the independent aner run examples/plot_spatial3d.aner, to create standalone HTML and static SVG files. Relative CSV paths use the process or kernel working directory, not the source or notebook folder. Downloaded notebooks need the same relative CSV folder tree or the same path edit in every format. Existing files are not replaced. Recipients can view HTML offline without Jupyter, Aner or map packs. Its initial camera is defined in source; a temporary browser view is not saved back into the chart. Boulder data is entirely synthetic local Cartesian coordinates and temperature, not real terrain or municipal observations. The shared Boulder code sets .rotation(x: 15.0, y: -10.0, z: 20.0).view_zoom(zoom: 1.2).time_frame(frame: 2), so playback starts paused at UI frame 3/6, advances uniformly once per second and stops at the end without interpolating observations. Its explicit labels are not parsed dates or elapsed time intervals. Coordinate domains and the 12 to 24 °C scale span the whole capture set; camera and observation selection persist while the inspector and table update. The table requires complete time/site/x/y/z/value cells, primitive finite Float64 values or Int64 values within ±9,007,199,254,740,992 (±2^53, inclusive), at most 120 frames and 10,000 total pairs. The original scatter3d_frames(...) remains available for explicit frame major matrices. Saved HTML embeds all captures; native static SVG exports the source selected capture and authored view with shared scales. Generic 4D spatial rotation, interpolated animation and volume rendering remain future work. See the plotting contracts and 4D evaluation.
Run All reads the CSV and displays the chart without writing exports. To save, add a new cell with a fresh HTML or SVG filename. Chart construction snapshots the complete table; changing or removing its CSV afterward does not affect retained values or exported pages. Rerun reading and construction to adopt edits. Saved HTML embeds all frames and local controls and needs neither the CSV nor a kernel to view offline.
Aner directly creates the experience from the shared program: .show() displays its interactive notebook output, and .save("fresh.html") writes the same standalone renderer and captured data to a standalone page. The source and both notebook formats use the same analysis; the website publishes those generated files and their source. Run All remains display only, and an optional new cell saves to fresh filenames.
Download PNG and Download SVG in the viewer capture the current labeled figure locally; PNG is limited proportionally to two million pixels and 4,096 pixels per dimension, and SVG stays vector with exact current frame metadata. Save interactive HTML embeds all captures and the current camera/XYZ/zoom/frame/selected observation/page, reopening paused without a kernel, CSV or map packs. These controls leave native Chart values and kernel variables unchanged. Notebook download/script policies still apply; use vector SVG or open standalone HTML if the frontend blocks local PNG rendering.
Expand Recreate this view in Aner to select and copy the generated view chain into your program. Replace its placeholder chart with boulder (or your Chart variable), assign the returned copy, and save to a fresh path. Source authored .rotation(x,y,z) angles are finite within ±180°, .view_zoom(zoom) accepts 0.5…3, and .time_frame(frame) requires a valid zero based captured frame index. All return immutable Chart copies. Native save uses authored state; the viewer's download buttons capture live state. Reset/Home return to the original authored orientation/zoom while retaining current frame and inspection state.
Interactive Boulder dashboard
Open the standard Jupyter dashboard notebook and select Aner. This is the same native analysis as the VS Code .anernb example, with a different notebook container. plot.site_dashboard_table(table).show() displays a linked map, bars, daily trends, availability heatmap, date range controls, site checklist and table. The example reads the local CSV with an explicit aner.data schema with required metadata and nullable counts and bounded collection: six illustrative Boulder sites on seven dates, all synthetic. Its code cells are byte identical in both notebook formats and form the analysis prefix of the .aner source. No map pack is needed. Run from the project root with examples/fixtures/plot_boulder_sites.csv relative to the kernel working directory; downloaded notebooks need that folder tree or a consistent path edit.
The kernel adapter forwards a bounded snapshot and a standalone HTML document from native Aner. It places that HTML in an opaque origin iframe with scripts restricted to the sandbox and network connections disabled by its content policy. Date and site changes use local data and do not contact the kernel. Saved notebooks follow the frontend's normal trust and script policies: inspect source and outputs before trusting a notebook. If the frontend suppresses scripts or HTML, the initial SVG remains available; open the exported HTML separately for interaction.
Run the .aner source from the project root with aner run examples/plot_site_dashboard.aner to generate boulder-dashboard.html in a writable working directory. The export uses a fresh filename and embeds all controls and the validated observations. Viewing a saved output or HTML page never reads the CSV; editing it requires a new read, construction and export. Duplicate site/date rows, missing date/site/position metadata, inconsistent coordinates and invalid nonmissing counts are rejected. Nullable counts and absent site/date rows remain missing, never zero. The adapter expands every calendar day between the first and last represented dates, including an interior date absent for all sites. It cannot infer dates outside those bounds or a site absent from the entire table. Complete materialized tables from other loaders use the same contract. The table adapter sorts dates and preserves first seen site order; the List based plot.site_dashboard remains available. A recipient can open it offline without an Aner session, separate authoring script, server or map installation. dashboard.html() returns the same document as a String. The notebook explains an optional Colorado boundary variant: only constructing it needs usa.co; its saved scene and HTML include the selected geometry and authored source caption. Ordinary geographic charts retain static SVG in standard Jupyter.
The missing data notebook, matching source and CSV demonstrate NA, omitted rows, a whole missing Wednesday and a measured zero. They use the same Aner analysis as the .anernb variant. A period total is N/A if any expected observation is missing; observed subtotal and coverage report available data separately. Weekday/weekend means require complete data in each included group. Trend lines stop at gaps, incomplete totals have neutral 5 px map markers, and measured zero retains zero area. The fixture has 31/42 observations and an observed subtotal of 13,780; setting both date inputs to Wednesday with all six sites selected gives N/A and coverage 0/6. These rules hold in the static SVG, saved notebook output and offline HTML page. No map pack is needed. Run aner run examples/plot_site_dashboard_missing.aner from the project root to export it; use a fresh filename when exporting again. Empty fields require an explicit missing: "" reader setting; this example recognizes unquoted NA instead.
The coverage heatmap, labeled Observation coverage, retains every site and date in the snapshot. Its colors show observed versus missing data, not count magnitude; measured zero counts as observed. Tooltips and accessible cell labels give the site, ISO date and count or N/A. Active sites and dates are highlighted without removing the surrounding availability context, and date/checklist changes update the map, bars, trends and table together. The grid reports full snapshot coverage; the status and summary table report coverage for the selected range.
Drag a rectangle across coverage cells with a mouse to select its inclusive site rows and date range, then release to update the map, bars, trends and summary together. Reverse dragging works too, including missing and measured zero cells. Ctrl/Cmd/Shift-drag adds those rows to the sites selected before the gesture while focusing the brushed date window; modifier click still toggles one site. The preview does not change filters until release. Escape during the gesture or pointer cancellation discards it and preserves the previous selection. Hold near or beyond a table edge to scroll to more cells; releasing outside uses the nearest visible cell at the current scroll position. The table may remain scrolled after cancellation.
Touch and pen retain table scrolling and single cell tap selection. Date inputs, the checklist, row buttons and keyboard controls remain available. The same .aner analysis supplies this brush in .anernb, Jupyter and offline HTML, with no additional API, data or map dependency. Use the updated native runtime and the matching Aner extension for .anernb; export a fresh HTML file to include the controls. Static SVG keeps its availability view and does not support brushing.
Click a cell to focus that site and single day. Ctrl/Cmd/Shift-click toggles the site and focuses the day, retaining other selected sites. A row header button focuses or modifier toggles a site while preserving the date range. Arrow keys and Home/End move focus; Enter or Space activates a cell. Large grids scroll within their own table. In the missing data example, Wednesday is missing in all six rows; North's Sunday is observed zero. Clicking either produces the same N/A/coverage or zero/coverage result in every view. The native SVG includes the initial grid, with stacked sections and repeated headers for long calendars; exact counts remain in cell titles when space is limited. .anernb, Jupyter and exported HTML add the linked controls and local table scrolling with no extra API or pack.
This API requires a matching dashboard enabled native runtime and kernel adapter. See the complete plotting contract and the page generated directly by Aner.
Runtime modes
Place control directives in separate cells:
| Directive | Behavior |
|---|---|
%aner dev | Enable bounded development observations; reset session state |
%aner dev values | Enable observations with bounded individual values; reset state |
%aner prod | Disable automatic recording; reset session state |
%aner timeout 600 | Set a 600 second limit for subsequent cells; retain session variables |
%aner reset | Clear native session state |
%aner variables | Display the most recent development observation without executing user code |
Production is the default. Mode changes and reset clear variables. These directives configure observation policy, not neural training/evaluation behavior.
Development observations
Completed cells expose read only variable tables, object references, Tensor placement, training loss curves, operation topology, and measured training progress when available. Wide tables and diagrams scroll within their panels. Each fit has a separate loss series; phase labels distinguish losses before an update from final trained loss. Mini batch observations additionally chart row weighted online loss, held out validation loss, and validation accuracy when supplied. These measurements appear after the completed cell.
The transport buffers output until a cell completes. Streaming progress, source breakpoints, live variable editing, and pause/step execution are not implemented. The standalone training report provides detailed dependencies, neurons, and available gradients; see development mode and visual training reports.
Limits and failure behavior
Each source request is limited to 1 MiB. The transport timeout defaults to 120 seconds and includes startup, request writing, and execution. Before a longer cell, run %aner timeout 600 in a separate cell. The argument must be an integer from 1 through 86,400 seconds. Changing the limit preserves current variables and affects subsequent cells; a running request keeps its original deadline. Interrupting a running request terminates its owned native session and clears variables. Observations have independent bounded payloads and report omitted values or timing events.
Notebook documents retain code, Markdown, metadata, and saved output. Saved output is historical document content; it is not a fitted model checkpoint. Distributed examples contain no saved execution output. .anernb is the VS Code notebook suffix; .ipynb is the notebook format used by this integration.