From d64f2eadc4f7012eb71c86aa3fe71fd21de2e472 Mon Sep 17 00:00:00 2001 From: chrishavlin Date: Thu, 30 Nov 2023 15:15:54 -0600 Subject: [PATCH] prep for v0.3.0 --- HISTORY.md | 9 + README.md | 2 +- docs/_static/yt-napari_0.3.0.json | 418 +++++++++++++++++++++ docs/_static/yt-napari_latest.json | 12 + docs/quickstart.rst | 14 + docs/schema.rst | 2 + src/yt_napari/schemas/yt-napari_0.3.0.json | 418 +++++++++++++++++++++ 7 files changed, 874 insertions(+), 1 deletion(-) create mode 100644 docs/_static/yt-napari_0.3.0.json create mode 100644 src/yt_napari/schemas/yt-napari_0.3.0.json diff --git a/HISTORY.md b/HISTORY.md index d65652f..43a10e1 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,12 @@ +## v0.3.0 + +This release introduces an initial metadata explorer widget and improvements to the +Reader widgets. + +### New Features +* Saving Reader widget selections to yt-napari JSON ([#108](https://github.com/data-exp-lab/yt-napari/pull/108), @TomasPetro) +* Metadata explorer widget: check fields available in a dataset + ## v0.2.1 Bugfix release. diff --git a/README.md b/README.md index 1c69156..8d42b45 100644 --- a/README.md +++ b/README.md @@ -232,7 +232,7 @@ task update_schema_docs It will simply copy over the existing on-disk schema files to the documentation. If you run with a version: ```commandline -task update_schema_docs vX.X.X +task update_schema_docs -v vX.X.X ``` It will write a schema file for the current pydantic model, overwriting any on-disk schema files for the provided version. diff --git a/docs/_static/yt-napari_0.3.0.json b/docs/_static/yt-napari_0.3.0.json new file mode 100644 index 0000000..04794a5 --- /dev/null +++ b/docs/_static/yt-napari_0.3.0.json @@ -0,0 +1,418 @@ +{ + "title": "InputModel", + "type": "object", + "properties": { + "datasets": { + "title": "Datasets", + "description": "list of dataset containers to load", + "type": "array", + "items": { + "$ref": "#/definitions/DataContainer" + } + }, + "timeseries": { + "title": "Timeseries", + "description": "List of timeseries to load", + "type": "array", + "items": { + "$ref": "#/definitions/Timeseries" + } + } + }, + "definitions": { + "ytField": { + "title": "ytField", + "type": "object", + "properties": { + "field_type": { + "title": "Field Type", + "description": "a field type in the yt dataset", + "type": "string" + }, + "field_name": { + "title": "Field Name", + "description": "a field in the yt dataset", + "type": "string" + }, + "take_log": { + "title": "Take Log", + "description": "if true, will apply log10 to the selected data", + "default": true, + "type": "boolean" + } + } + }, + "Left_Edge": { + "title": "Left_Edge", + "type": "object", + "properties": { + "value": { + "title": "Value", + "description": "3-element unitful tuple.", + "default": [ + 0.0, + 0.0, + 0.0 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "number" + }, + { + "type": "number" + }, + { + "type": "number" + } + ] + }, + "unit": { + "title": "Unit", + "description": "the unit length string.", + "default": "code_length", + "type": "string" + } + } + }, + "Right_Edge": { + "title": "Right_Edge", + "type": "object", + "properties": { + "value": { + "title": "Value", + "description": "3-element unitful tuple.", + "default": [ + 1.0, + 1.0, + 1.0 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "number" + }, + { + "type": "number" + }, + { + "type": "number" + } + ] + }, + "unit": { + "title": "Unit", + "description": "the unit length string.", + "default": "code_length", + "type": "string" + } + } + }, + "Region": { + "title": "Region", + "type": "object", + "properties": { + "fields": { + "title": "Fields", + "description": "list of fields to load for this selection", + "type": "array", + "items": { + "$ref": "#/definitions/ytField" + } + }, + "left_edge": { + "title": "Left Edge", + "description": "the left edge (min x, min y, min z)", + "allOf": [ + { + "$ref": "#/definitions/Left_Edge" + } + ] + }, + "right_edge": { + "title": "Right Edge", + "description": "the right edge (max x, max y, max z)", + "allOf": [ + { + "$ref": "#/definitions/Right_Edge" + } + ] + }, + "resolution": { + "title": "Resolution", + "description": "the resolution at which to sample between the edges.", + "default": [ + 400, + 400, + 400 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "integer" + }, + { + "type": "integer" + }, + { + "type": "integer" + } + ] + }, + "rescale": { + "title": "Rescale", + "description": "rescale the final image between 0,1", + "default": false, + "type": "boolean" + } + } + }, + "Length_Tuple": { + "title": "Length_Tuple", + "type": "object", + "properties": { + "value": { + "title": "Value", + "description": "3-element unitful tuple.", + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "number" + }, + { + "type": "number" + }, + { + "type": "number" + } + ] + }, + "unit": { + "title": "Unit", + "description": "the unit length string.", + "default": "code_length", + "type": "string" + } + } + }, + "Length_Value": { + "title": "Length_Value", + "type": "object", + "properties": { + "value": { + "title": "Value", + "description": "Single unitful value.", + "type": "number" + }, + "unit": { + "title": "Unit", + "description": "the unit length string.", + "default": "code_length", + "type": "string" + } + } + }, + "Slice": { + "title": "Slice", + "type": "object", + "properties": { + "fields": { + "title": "Fields", + "description": "list of fields to load for this selection", + "type": "array", + "items": { + "$ref": "#/definitions/ytField" + } + }, + "normal": { + "title": "Normal", + "description": "the normal axis of the slice", + "type": "string" + }, + "center": { + "title": "Center", + "description": "The center point of the slice, default domain center", + "allOf": [ + { + "$ref": "#/definitions/Length_Tuple" + } + ] + }, + "slice_width": { + "title": "Slice Width", + "description": "The slice width, defaults to full domain", + "allOf": [ + { + "$ref": "#/definitions/Length_Value" + } + ] + }, + "slice_height": { + "title": "Slice Height", + "description": "The slice width, defaults to full domain", + "allOf": [ + { + "$ref": "#/definitions/Length_Value" + } + ] + }, + "resolution": { + "title": "Resolution", + "description": "the resolution at which to sample the slice", + "default": [ + 400, + 400 + ], + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ + { + "type": "integer" + }, + { + "type": "integer" + } + ] + }, + "periodic": { + "title": "Periodic", + "description": "should the slice be periodic? default False.", + "default": false, + "type": "boolean" + }, + "rescale": { + "title": "Rescale", + "description": "rescale the final image between 0,1", + "default": false, + "type": "boolean" + } + } + }, + "SelectionObject": { + "title": "SelectionObject", + "type": "object", + "properties": { + "regions": { + "title": "Regions", + "description": "a list of regions to load", + "type": "array", + "items": { + "$ref": "#/definitions/Region" + } + }, + "slices": { + "title": "Slices", + "description": "a list of slices to load", + "type": "array", + "items": { + "$ref": "#/definitions/Slice" + } + } + } + }, + "DataContainer": { + "title": "DataContainer", + "type": "object", + "properties": { + "filename": { + "title": "Filename", + "description": "the filename for the dataset", + "type": "string" + }, + "selections": { + "title": "Selections", + "description": "selections to load in this dataset", + "allOf": [ + { + "$ref": "#/definitions/SelectionObject" + } + ] + }, + "store_in_cache": { + "title": "Store In Cache", + "description": "if enabled, will store references to yt datasets.", + "default": true, + "type": "boolean" + } + } + }, + "TimeSeriesFileSelection": { + "title": "TimeSeriesFileSelection", + "type": "object", + "properties": { + "directory": { + "title": "Directory", + "description": "The directory of the timseries", + "type": "string" + }, + "file_pattern": { + "title": "File Pattern", + "description": "The file pattern to match", + "type": "string" + }, + "file_list": { + "title": "File List", + "description": "List of files to load.", + "type": "array", + "items": { + "type": "string" + } + }, + "file_range": { + "title": "File Range", + "description": "Given files matched by file_pattern, this option will select a range. Argument orderis taken as start:stop:step.", + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "integer" + }, + { + "type": "integer" + }, + { + "type": "integer" + } + ] + } + } + }, + "Timeseries": { + "title": "Timeseries", + "type": "object", + "properties": { + "file_selection": { + "$ref": "#/definitions/TimeSeriesFileSelection" + }, + "selections": { + "title": "Selections", + "description": "selections to load in this dataset", + "allOf": [ + { + "$ref": "#/definitions/SelectionObject" + } + ] + }, + "load_as_stack": { + "title": "Load As Stack", + "description": "If True, will stack images along a new dimension.", + "default": false, + "type": "boolean" + } + }, + "required": [ + "file_selection" + ] + } + } +} diff --git a/docs/_static/yt-napari_latest.json b/docs/_static/yt-napari_latest.json index 6ed4f9f..04794a5 100644 --- a/docs/_static/yt-napari_latest.json +++ b/docs/_static/yt-napari_latest.json @@ -164,6 +164,12 @@ "type": "integer" } ] + }, + "rescale": { + "title": "Rescale", + "description": "rescale the final image between 0,1", + "default": false, + "type": "boolean" } } }, @@ -282,6 +288,12 @@ "description": "should the slice be periodic? default False.", "default": false, "type": "boolean" + }, + "rescale": { + "title": "Rescale", + "description": "rescale the final image between 0,1", + "default": false, + "type": "boolean" } } }, diff --git a/docs/quickstart.rst b/docs/quickstart.rst index ed74c9d..179ee0d 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -105,6 +105,20 @@ selections can easily exceed available memory if you're not careful... for impro bigger-than-memory arrays, you can instead use the jupyter notebook interface for napari with the `yt_napari.timeseries` module of helper functions to distribute the timestep selections using dask. See the example notebooks for usage. + +Saving a selection: +################### + +For both the yt Reader and Time Series Reader, you can save your selection configuration +to a JSON file by clicking "Save Selection". This will save a yt-napari JSON file +that you can later re-load (see :ref:`loading a json file from the napari gui`). + +The yt-napari Metadata explorer: +################################ + +The Metadata explorer widget will display some basic information about a selected yt +dataset including available fields and domain extent. + .. _configfile: Configuring yt-napari diff --git a/docs/schema.rst b/docs/schema.rst index 024258c..f3e4f11 100644 --- a/docs/schema.rst +++ b/docs/schema.rst @@ -17,6 +17,8 @@ The following versions are available (latest first): .. schemalistanchor! the following table is auto-generated by repo_utilites/update_schema_docs.py, Do not edit below this line. +yt-napari_0.3.0.json : `view <_static/yt-napari_0.3.0.json>`_ , :download:`download <_static/yt-napari_0.3.0.json>` + yt-napari_0.2.1.json : `view <_static/yt-napari_0.2.1.json>`_ , :download:`download <_static/yt-napari_0.2.1.json>` yt-napari_0.2.0.json : `view <_static/yt-napari_0.2.0.json>`_ , :download:`download <_static/yt-napari_0.2.0.json>` diff --git a/src/yt_napari/schemas/yt-napari_0.3.0.json b/src/yt_napari/schemas/yt-napari_0.3.0.json new file mode 100644 index 0000000..04794a5 --- /dev/null +++ b/src/yt_napari/schemas/yt-napari_0.3.0.json @@ -0,0 +1,418 @@ +{ + "title": "InputModel", + "type": "object", + "properties": { + "datasets": { + "title": "Datasets", + "description": "list of dataset containers to load", + "type": "array", + "items": { + "$ref": "#/definitions/DataContainer" + } + }, + "timeseries": { + "title": "Timeseries", + "description": "List of timeseries to load", + "type": "array", + "items": { + "$ref": "#/definitions/Timeseries" + } + } + }, + "definitions": { + "ytField": { + "title": "ytField", + "type": "object", + "properties": { + "field_type": { + "title": "Field Type", + "description": "a field type in the yt dataset", + "type": "string" + }, + "field_name": { + "title": "Field Name", + "description": "a field in the yt dataset", + "type": "string" + }, + "take_log": { + "title": "Take Log", + "description": "if true, will apply log10 to the selected data", + "default": true, + "type": "boolean" + } + } + }, + "Left_Edge": { + "title": "Left_Edge", + "type": "object", + "properties": { + "value": { + "title": "Value", + "description": "3-element unitful tuple.", + "default": [ + 0.0, + 0.0, + 0.0 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "number" + }, + { + "type": "number" + }, + { + "type": "number" + } + ] + }, + "unit": { + "title": "Unit", + "description": "the unit length string.", + "default": "code_length", + "type": "string" + } + } + }, + "Right_Edge": { + "title": "Right_Edge", + "type": "object", + "properties": { + "value": { + "title": "Value", + "description": "3-element unitful tuple.", + "default": [ + 1.0, + 1.0, + 1.0 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "number" + }, + { + "type": "number" + }, + { + "type": "number" + } + ] + }, + "unit": { + "title": "Unit", + "description": "the unit length string.", + "default": "code_length", + "type": "string" + } + } + }, + "Region": { + "title": "Region", + "type": "object", + "properties": { + "fields": { + "title": "Fields", + "description": "list of fields to load for this selection", + "type": "array", + "items": { + "$ref": "#/definitions/ytField" + } + }, + "left_edge": { + "title": "Left Edge", + "description": "the left edge (min x, min y, min z)", + "allOf": [ + { + "$ref": "#/definitions/Left_Edge" + } + ] + }, + "right_edge": { + "title": "Right Edge", + "description": "the right edge (max x, max y, max z)", + "allOf": [ + { + "$ref": "#/definitions/Right_Edge" + } + ] + }, + "resolution": { + "title": "Resolution", + "description": "the resolution at which to sample between the edges.", + "default": [ + 400, + 400, + 400 + ], + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "integer" + }, + { + "type": "integer" + }, + { + "type": "integer" + } + ] + }, + "rescale": { + "title": "Rescale", + "description": "rescale the final image between 0,1", + "default": false, + "type": "boolean" + } + } + }, + "Length_Tuple": { + "title": "Length_Tuple", + "type": "object", + "properties": { + "value": { + "title": "Value", + "description": "3-element unitful tuple.", + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "number" + }, + { + "type": "number" + }, + { + "type": "number" + } + ] + }, + "unit": { + "title": "Unit", + "description": "the unit length string.", + "default": "code_length", + "type": "string" + } + } + }, + "Length_Value": { + "title": "Length_Value", + "type": "object", + "properties": { + "value": { + "title": "Value", + "description": "Single unitful value.", + "type": "number" + }, + "unit": { + "title": "Unit", + "description": "the unit length string.", + "default": "code_length", + "type": "string" + } + } + }, + "Slice": { + "title": "Slice", + "type": "object", + "properties": { + "fields": { + "title": "Fields", + "description": "list of fields to load for this selection", + "type": "array", + "items": { + "$ref": "#/definitions/ytField" + } + }, + "normal": { + "title": "Normal", + "description": "the normal axis of the slice", + "type": "string" + }, + "center": { + "title": "Center", + "description": "The center point of the slice, default domain center", + "allOf": [ + { + "$ref": "#/definitions/Length_Tuple" + } + ] + }, + "slice_width": { + "title": "Slice Width", + "description": "The slice width, defaults to full domain", + "allOf": [ + { + "$ref": "#/definitions/Length_Value" + } + ] + }, + "slice_height": { + "title": "Slice Height", + "description": "The slice width, defaults to full domain", + "allOf": [ + { + "$ref": "#/definitions/Length_Value" + } + ] + }, + "resolution": { + "title": "Resolution", + "description": "the resolution at which to sample the slice", + "default": [ + 400, + 400 + ], + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": [ + { + "type": "integer" + }, + { + "type": "integer" + } + ] + }, + "periodic": { + "title": "Periodic", + "description": "should the slice be periodic? default False.", + "default": false, + "type": "boolean" + }, + "rescale": { + "title": "Rescale", + "description": "rescale the final image between 0,1", + "default": false, + "type": "boolean" + } + } + }, + "SelectionObject": { + "title": "SelectionObject", + "type": "object", + "properties": { + "regions": { + "title": "Regions", + "description": "a list of regions to load", + "type": "array", + "items": { + "$ref": "#/definitions/Region" + } + }, + "slices": { + "title": "Slices", + "description": "a list of slices to load", + "type": "array", + "items": { + "$ref": "#/definitions/Slice" + } + } + } + }, + "DataContainer": { + "title": "DataContainer", + "type": "object", + "properties": { + "filename": { + "title": "Filename", + "description": "the filename for the dataset", + "type": "string" + }, + "selections": { + "title": "Selections", + "description": "selections to load in this dataset", + "allOf": [ + { + "$ref": "#/definitions/SelectionObject" + } + ] + }, + "store_in_cache": { + "title": "Store In Cache", + "description": "if enabled, will store references to yt datasets.", + "default": true, + "type": "boolean" + } + } + }, + "TimeSeriesFileSelection": { + "title": "TimeSeriesFileSelection", + "type": "object", + "properties": { + "directory": { + "title": "Directory", + "description": "The directory of the timseries", + "type": "string" + }, + "file_pattern": { + "title": "File Pattern", + "description": "The file pattern to match", + "type": "string" + }, + "file_list": { + "title": "File List", + "description": "List of files to load.", + "type": "array", + "items": { + "type": "string" + } + }, + "file_range": { + "title": "File Range", + "description": "Given files matched by file_pattern, this option will select a range. Argument orderis taken as start:stop:step.", + "type": "array", + "minItems": 3, + "maxItems": 3, + "items": [ + { + "type": "integer" + }, + { + "type": "integer" + }, + { + "type": "integer" + } + ] + } + } + }, + "Timeseries": { + "title": "Timeseries", + "type": "object", + "properties": { + "file_selection": { + "$ref": "#/definitions/TimeSeriesFileSelection" + }, + "selections": { + "title": "Selections", + "description": "selections to load in this dataset", + "allOf": [ + { + "$ref": "#/definitions/SelectionObject" + } + ] + }, + "load_as_stack": { + "title": "Load As Stack", + "description": "If True, will stack images along a new dimension.", + "default": false, + "type": "boolean" + } + }, + "required": [ + "file_selection" + ] + } + } +}