Skip to content

Commit

Permalink
DOCS: Create Python tutorial covering basic usage and filter writing (B…
Browse files Browse the repository at this point in the history
…lueQuartzSoftware#925)

Signed-off-by: Michael Jackson <[email protected]>
Signed-off-by: Joey Kleingers <[email protected]>
Co-authored-by: Joey Kleingers <[email protected]>
  • Loading branch information
imikejackson and joeykleingers committed Jun 13, 2024
1 parent cac93d6 commit a76974b
Show file tree
Hide file tree
Showing 53 changed files with 1,582 additions and 66 deletions.
6 changes: 3 additions & 3 deletions conda/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ cxx_compiler:

c_compiler_version: # [unix]
- 10.4.0 # [linux]
- 17.0.6 # [osx]

cxx_compiler_version:
- 10.4.0 # [linux]
- 17.0.6 # [osx]

python:
- 3.12
- 3.11
- 3.10
- 3.9

10 changes: 5 additions & 5 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "simplnx" %}
{% set version = "1.4.0" %}
{% set version = "1.5.0" %}

package:
name: {{ name|lower }}
Expand All @@ -9,19 +9,19 @@ source:
- path: ../
folder: simplnx
- git_url: https://github.com/BlueQuartzSoftware/EbsdLib
git_rev: v1.0.26
git_rev: v1.0.29
folder: EbsdLib
- git_url: https://github.com/BlueQuartzSoftware/H5Support
git_rev: v1.0.13
folder: H5Support
- git_url: https://github.com/martinmoene/expected-lite
git_rev: v0.5.0
git_rev: v0.6.3
folder: expected-lite
- git_url: https://github.com/fr00b0/nod
git_rev: v0.5.2
git_rev: v0.5.3
folder: nod
- git_url: https://github.com/martinmoene/span-lite
git_rev: v0.10.3
git_rev: v0.11.0
folder: span-lite
- url: https://raw.githubusercontent.com/BlueQuartzSoftware/simplnx-registry/9a5db7b5fa02b2495eb51654cbaab3c63820c779/ports/nod/CMakeLists.txt
folder: nod
Expand Down
12 changes: 6 additions & 6 deletions conda/recipe.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
context:
version: "1.4.0"
version: "1.5.0"
name: simplnx

package:
Expand All @@ -10,21 +10,21 @@ source:
- path: ../
folder: simplnx
- git_url: https://github.com/BlueQuartzSoftware/EbsdLib
git_rev: v1.0.26
git_rev: v1.0.29
folder: EbsdLib
- git_url: https://github.com/BlueQuartzSoftware/H5Support
git_rev: v1.0.13
folder: H5Support
- git_url: https://github.com/martinmoene/expected-lite
git_rev: v0.5.0
git_rev: v0.6.3
folder: expected-lite
- git_url: https://github.com/fr00b0/nod
git_rev: v0.5.2
git_rev: v0.5.3
folder: nod
- git_url: https://github.com/martinmoene/span-lite
git_rev: v0.10.3
git_rev: v0.11.0
folder: span-lite
- url: https://raw.githubusercontent.com/bluequartzsoftware/simplnx-registry/9a5db7b5fa02b2495eb51654cbaab3c63820c779/ports/nod/CMakeLists.txt
- url: https://raw.githubusercontent.com/BlueQuartzSoftware/simplnx-registry/9a5db7b5fa02b2495eb51654cbaab3c63820c779/ports/nod/CMakeLists.txt
folder: nod
- git_url: https://github.com/insightsoftwareconsortium/ITK
git_rev: v5.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Parameters ITKLabelContourImageFilter::parameters() const
params.insertSeparator(Parameters::Separator{"Input Parameter(s)"});
params.insert(std::make_unique<BoolParameter>(k_FullyConnected_Key, "Fully Connected",
"Set/Get whether the connected components are defined strictly by face connectivity or by face+edge+vertex connectivity. Default is FullyConnectedOff. "
"Note For objects that are 1 pixel wide, use FullyConnectedOn.",
"**NOTE** For objects that are 1 pixel wide, use FullyConnectedOn.",
false));
params.insert(std::make_unique<Float64Parameter>(k_BackgroundValue_Key, "Background Value",
"Set/Get the background value used to identify the objects and mark the pixels not on the border of the objects.", 0));
Expand Down
23 changes: 15 additions & 8 deletions src/Plugins/TestOne/src/TestOne/Filters/ExampleFilter2Filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "simplnx/Common/StringLiteral.hpp"
#include "simplnx/Parameters/ArrayCreationParameter.hpp"
#include "simplnx/Parameters/ArraySelectionParameter.hpp"
#include "simplnx/Parameters/AttributeMatrixSelectionParameter.hpp"
#include "simplnx/Parameters/BoolParameter.hpp"
#include "simplnx/Parameters/ChoicesParameter.hpp"
#include "simplnx/Parameters/DataGroupCreationParameter.hpp"
Expand Down Expand Up @@ -30,6 +31,7 @@ constexpr StringLiteral k_Param10 = "param10_path";
constexpr StringLiteral k_Param11 = "param11_path";
constexpr StringLiteral k_Param12 = "param12s";
constexpr StringLiteral k_Param13 = "param13";
constexpr StringLiteral k_Param30 = "param30_path";

} // namespace

Expand Down Expand Up @@ -81,6 +83,18 @@ Parameters ExampleFilter2Filter::parameters() const
params.insert(std::make_unique<DynamicTableParameter>(k_Param13, "Dynamic Table Parameter", "DynamicTableParameter Example Help Text", defaultTable, tableInfo));

// These should show up under the "Required Objects" Section in the GUI

// params.linkParameters(k_Param3, k_Param10, std::make_any<ChoicesParameter::ValueType>(0));
// params.linkParameters(k_Param3, k_Param6, std::make_any<ChoicesParameter::ValueType>(1));
// params.linkParameters(k_Param3, k_Param11, std::make_any<ChoicesParameter::ValueType>(2));

// These should show up under the "Created Objects" section in the GUI

params.insertSeparator(Parameters::Separator{"Data Object Parameters"});

params.insert(std::make_unique<DataGroupCreationParameter>(k_Param8, "DataGroup Creation Parameter", "Example data group creation help text", DataPath{}));
params.insert(std::make_unique<ArrayCreationParameter>(k_Param5, "Array Creation", "Example array creation help text", ArrayCreationParameter::ValueType{}));

params.insert(std::make_unique<DataGroupSelectionParameter>(k_Param9, "DataGroup Selection Parameter", "Example data group selection help text", DataPath{},
DataGroupSelectionParameter::AllowedTypes{BaseGroup::GroupType::DataGroup}));
params.insert(std::make_unique<DataPathSelectionParameter>(k_Param10, "DataPath Selection Parameter", "Example data path selection help text", DataPath{}));
Expand All @@ -89,17 +103,10 @@ Parameters ExampleFilter2Filter::parameters() const
std::make_unique<GeometrySelectionParameter>(k_Param11, "Geometry Selection Parameter", "Example geometry selection help text", DataPath{}, GeometrySelectionParameter::AllowedTypes{}));
params.insert(std::make_unique<MultiArraySelectionParameter>(k_Param12, "MultiArray Selection Parameter", "Example multiarray selection help text", MultiArraySelectionParameter::ValueType{},
MultiArraySelectionParameter::AllowedTypes{IArray::ArrayType::Any}, nx::core::GetAllDataTypes()));
params.insert(std::make_unique<AttributeMatrixSelectionParameter>(k_Param30, "Attribute Matrix Selection", "Example Help Text", DataPath{}));

params.linkParameters(k_Param7, k_Param9, std::make_any<BoolParameter::ValueType>(true));

params.linkParameters(k_Param3, k_Param10, std::make_any<ChoicesParameter::ValueType>(0));
params.linkParameters(k_Param3, k_Param6, std::make_any<ChoicesParameter::ValueType>(1));
params.linkParameters(k_Param3, k_Param11, std::make_any<ChoicesParameter::ValueType>(2));

// These should show up under the "Created Objects" section in the GUI
params.insert(std::make_unique<DataGroupCreationParameter>(k_Param8, "DataGroup Creation Parameter", "Example data group creation help text", DataPath{}));
params.insert(std::make_unique<ArrayCreationParameter>(k_Param5, "Array Creation", "Example array creation help text", ArrayCreationParameter::ValueType{}));

return params;
}

Expand Down
24 changes: 24 additions & 0 deletions wrapping/python/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,27 @@ cd simplnx/docs/
make clean
make html
```

## Restructured Text Heading Levels

=====================================
Page Title
=====================================

###################################
Part Title
###################################

Heading 1
=========

Heading 2
---------

Heading 3
^^^^^^^^^

Heading 4
""""""""""


4 changes: 2 additions & 2 deletions wrapping/python/docs/generate_sphinx_docs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,8 @@ void GeneratePythonRstFiles()
rstStream << ")\n\n";

rstStream << memberStream.str();
rstStream << " :return: Returns a :ref:`Result <result>` object that holds any warnings and/or errors that were encountered during execution.\n";
rstStream << " :rtype: :ref:`simplnx.Result <result>`\n\n";
rstStream << " :return: Returns a :ref:`nx.IFilter.ExecuteResult <result>` object that holds any warnings and/or errors that were encountered during execution.\n";
rstStream << " :rtype: :ref:`nx.IFilter.ExecuteResult <result>`\n\n";
rstStream << '\n';
}
}
Expand Down
5 changes: 4 additions & 1 deletion wrapping/python/docs/index_template.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,17 @@ How to use SIMPLNX from Python
Overview
DataObjects
Geometry
Reference_Frame_Notes

.. toctree::
:maxdepth: 2
:caption: Using SIMPLNX in Python

Python_Introduction
User_API
Reference_Frame_Notes
Tutorial_1
Tutorial_2
Tutorial_3

.. toctree::
:maxdepth: 1
Expand Down
Loading

0 comments on commit a76974b

Please sign in to comment.