diff --git a/src/simplnx/Core/Application.cpp b/src/simplnx/Core/Application.cpp index e93a7dcead..0c487471ee 100644 --- a/src/simplnx/Core/Application.cpp +++ b/src/simplnx/Core/Application.cpp @@ -215,6 +215,11 @@ std::vector Application::getSimplUuid(const Uuid& simplnxUuid) void Application::loadPlugins(const std::filesystem::path& pluginDir, bool verbose) { + if(!std::filesystem::exists(pluginDir) && verbose) + { + fmt::print("Plugin Directory {} does not exist. Skipping", pluginDir.string()); + return; + } if(verbose) { fmt::print("Loading Plugins from {}\n", pluginDir.string()); diff --git a/wrapping/python/docs/generate_sphinx_docs.cpp b/wrapping/python/docs/generate_sphinx_docs.cpp index 1f5aae98d8..a4a75ac91d 100644 --- a/wrapping/python/docs/generate_sphinx_docs.cpp +++ b/wrapping/python/docs/generate_sphinx_docs.cpp @@ -28,7 +28,7 @@ namespace std::map s_ParameterMap; const std::string k_WebServerAddress = "http://www.dream3d.io/nx_reference_manual"; -const std::string k_WebServerFilterFolder = "Filters"; +const std::string k_WebServerFilterFolder = "html"; } // namespace #define ADD_PARAMETER_TRAIT(thing1, thing2) \ @@ -748,7 +748,7 @@ void GeneratePythonRstFiles() rstStream << " " << rstDescription << "\n\n"; // Tack on the link to the web address for the full documentation - const std::string webAddress = fmt::format("{}/{}/{}", k_WebServerAddress, k_WebServerFilterFolder, filterClassName); + const std::string webAddress = fmt::format("{}/{}/{}/{}.html", k_WebServerAddress, k_WebServerFilterFolder, plugName, filterClassName); rstStream << " `Link to the full online documentation for " << filterClassName << " <" << webAddress << ">`_ \n\n"; const auto& parameters = filter->parameters(); diff --git a/wrapping/python/docs/index_template.rst b/wrapping/python/docs/index_template.rst index 5275e08474..b3cdccba59 100644 --- a/wrapping/python/docs/index_template.rst +++ b/wrapping/python/docs/index_template.rst @@ -5,7 +5,7 @@ DREAM3D-NX Python Docs ======================= -Latest Version: 1.2.6 +Latest Version: 1.2.7 --------------------- The *simplnx* library can be installed through an Anaconda packages from the *BlueQuartzSoftware* channel. This can be achieved @@ -21,24 +21,45 @@ by creating a new virtual environment .. toctree:: :maxdepth: 3 - :caption: Contents: + :caption: Conceptual Installation Overview DataObjects Geometry - User_API - Developer_API + +.. toctree:: + :maxdepth: 3 + :caption: Using SIMPLNX + Python_Introduction - Writing_A_New_Python_Filter + User_API Reference_Frame_Notes + +.. toctree:: + :maxdepth: 3 + :caption: Filter Writers + + Writing_A_New_Python_Filter + Developer_API + +.. toctree:: + :maxdepth: 1 + :caption: Filter API/Docs + +@PLUGIN_LIST@ + +.. toctree:: + :maxdepth: 1 + :caption: Release Notes + ReleaseNotes_110 ReleaseNotes_120 ReleaseNotes_121 ReleaseNotes_123 ReleaseNotes_124 ReleaseNotes_126 -@PLUGIN_LIST@ + ReleaseNotes_127 Indices and tables ================== diff --git a/wrapping/python/docs/source/Developer_API.rst b/wrapping/python/docs/source/Developer_API.rst index 5b5cbca5c2..8d295663bf 100644 --- a/wrapping/python/docs/source/Developer_API.rst +++ b/wrapping/python/docs/source/Developer_API.rst @@ -1,5 +1,5 @@ -API for Developers -=================== +SIMPLNX Filter Writing API +========================== General Parameters ------------------ diff --git a/wrapping/python/docs/source/Installation.rst b/wrapping/python/docs/source/Installation.rst index 7abf6ea493..fbb3d34438 100644 --- a/wrapping/python/docs/source/Installation.rst +++ b/wrapping/python/docs/source/Installation.rst @@ -1,11 +1,19 @@ Installation ============ -Latest Version: 1.2.6 +Latest Version: 1.2.7 --------------------- The *simplnx* library can be installed through an Anaconda packages from the *BlueQuartzSoftware* channel. This can be achieved -by creating a new virtual environment +by creating a new virtual environment and installing SIMPLNX into that environment. + + +SIMPLNX Installation +^^^^^^^^^^^^^^^^^^^^ + +.. attention:: + + This kind of installation will allow you to utilize the SIMPLNX library through python. .. code:: shell @@ -15,3 +23,20 @@ by creating a new virtual environment conda activate nxpython conda install -c bluequartzsoftware simplnx + + +Full DREAM3D-NX Installation +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. attention:: + + This kind of installation will allow you to utilize the full DREAM3D-NX application + +.. code:: shell + + conda config --add channels conda-forge + conda config --set channel_priority strict + conda create -n nxpython python=3.10 + conda activate nxpython + conda install -c bluequartzsoftware dream3dnx + diff --git a/wrapping/python/docs/source/Python_Introduction.rst b/wrapping/python/docs/source/Python_Introduction.rst index 1f3da23e24..1c525f7bfd 100644 --- a/wrapping/python/docs/source/Python_Introduction.rst +++ b/wrapping/python/docs/source/Python_Introduction.rst @@ -303,7 +303,20 @@ Interoperating with Numpy This will hopefully be addressed in a future update. -This code example shows how to create a simplnx DataArray and then use that array +SIMPLNX DataArray objects are exposed to python through the use of a numpy view into the Data Array. This means that any modifications +to the numpy view are immediately reflected in the DataArray itself. This kind of interaction opens up many 3rd party libraries that +operate on numpy arrays and views such as numpy itself, pillow (for image processing), scipy and others. + +Once the DataStructure has a DataArray allocated into it through the use of a filter, the user can get a view of that +DataArray through the following: + +.. code:: python + + output_array_path = nx.DataPath(["Image Geometry/Cell Data/RGB"]) + rgb_np_view = data_structure[output_array_path].npview() + + +The following code examples show how to create a simplnx DataArray and then use that array as a numpy view. The next code section was take from `basic_arrays.py `__ @@ -345,7 +358,8 @@ The next code section was take from `basic_arrays.py str: """This returns the name of the filter as a user of DREAM3DNX would see it :return: The filter's human name :rtype: string """ - return 'FirstFilter' # This could be updated to return 'First Filter' or '1st Filter', or any other human-readable name. + return 'My First Filter' # This could be updated to return 'First Filter' or '1st Filter', or any other human-readable name. - **Class Name Method:** This method returns the programmatic name for the filter. + - The value should use the 'CamelCase' style with **NO SPACES** + .. code-block:: python def class_name(self) -> str: @@ -189,6 +232,8 @@ The skeleton provides a basic structure with placeholders and conventions that a - **Name Method:** This method returns a generic name for the filter. + - The value should use the 'CamelCase' style with **NO SPACES** + .. code-block:: python def name(self) -> str: @@ -207,7 +252,7 @@ The skeleton provides a basic structure with placeholders and conventions that a :return: The default tags for the filter :rtype: list """ - return ['python'] + return ['python', 'IO', 'Some Algorithm'] - **Clone Method:** This method returns a new instance of the filter. This method should not be modified. @@ -220,7 +265,7 @@ The skeleton provides a basic structure with placeholders and conventions that a """ return FirstFilter() -- **Parameters Method:** Add *simplnx* filter parameters to this method to configure what inputs are available to users of the filter. +- **Parameters Method:** This method defines the parameters that a user of your filter would see in the user interface or have access to if using your filter from another instance of python. .. code-block:: python @@ -231,7 +276,7 @@ The skeleton provides a basic structure with placeholders and conventions that a return params -- **Preflight and Execute Methods:** These are crucial methods where your filter's logic will reside. +- **Preflight and Execute Methods:** These are crucial methods where your filter's logic will reside. The preflight_impl() is called every time an input parameter is modified in the user interface therefor the preflight_impl should run as fast as possible. The execute_impl() method is where the actual work that your filter performs is kept. .. code-block:: python @@ -241,7 +286,7 @@ The skeleton provides a basic structure with placeholders and conventions that a def execute_impl(self, data_structure: nx.DataStructure, args: dict, message_handler: nx.IFilter.MessageHandler, should_cancel: nx.AtomicBoolProxy) -> nx.IFilter.ExecuteResult: # Execution logic -5. Defining Parameters +1. Defining Parameters ---------------------- Parameters determine what inputs are available to users; they make your filter configurable and adaptable to different datasets and scenarios. @@ -278,7 +323,7 @@ Parameters determine what inputs are available to users; they make your filter c return params - For the full list of parameters and their arguments, please see `Developer_API `__. + For the full list of parameters and their arguments, please see `SIMPLNX Filter Writer API Section `__. To see examples of how to instantiate each parameter, check out `ExampleFilter1 `__ and `ExampleFilter2 `__. @@ -377,7 +422,7 @@ performed. init_value: float = args[FirstFilter.INIT_VALUE_KEY] output_array_path: nx.DataPath = args[FirstFilter.OUTPUT_ARRAY_PATH] -- **Access Data Arrays/Objects From The Data Structure:** +- **Access Data Arrays/Objects from the Data Structure:** - Use DataPaths to get a reference to data arrays and other data objects from the data structure. .. code-block:: python @@ -386,7 +431,7 @@ performed. output_data_array: nx.IDataArray = data_structure[output_array_path] - **Manipulating Data Arrays With Numpy:** - - Get a numpy view into data arrays and then set values into the arrays using numpy. + - Get a numpy view into data arrays and then set values into the arrays using numpy. This gives a view of the data, **NOT A COPY**. Anything you have numpy do that is done "in place" will directly write those values into the stored DataArray. .. code-block:: python @@ -396,8 +441,15 @@ performed. # Set the init value into every index of the array data[:] = init_value -Conclusion ----------- -By following this guide, you can create a custom Python filter for *simplnx* that is configurable, follows best practices, and integrates smoothly into data processing pipelines. Remember to thoroughly test your filter with different parameter configurations and datasets to ensure its robustness and correctness. +9. Providing Feedback to the user during execution. +--------------------------------------------------- + + Both the preflight_impl and execute_impl have a 'message_handler' variable that is available for use to send back progress or other information to the user interface. The use of the message_handler should be tempered to only send back useful information. Sending ever iteration inside a tight loop will slow down your filter. + + .. code-block:: python + + # use the 'message_handler' to send back progress or information updates + message_handler(nx.IFilter.Message(nx.IFilter.Message.Type.Info, f'Calculating Histogram Counts and Bin Bounds...')) + For more Python filter examples, check out the `ExamplePlugin `_. \ No newline at end of file diff --git a/wrapping/python/docs/source/conf.py b/wrapping/python/docs/source/conf.py index a116902deb..e00ceef224 100644 --- a/wrapping/python/docs/source/conf.py +++ b/wrapping/python/docs/source/conf.py @@ -9,7 +9,7 @@ project = 'DREAM3D-NX' copyright = '2024, BlueQuartz Software, LLC' author = 'BlueQuartz Software, LLC' -release = '1.2.4' +release = '1.2.7' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration