Skip to content

Commit

Permalink
BUG: Various small bug fixes and corrections (#1131)
Browse files Browse the repository at this point in the history
* BUG: Fix various spelling mistakes in customer facing error messages

Signed-off-by: Michael Jackson <[email protected]>

* DOC: Fix spelling mistakes

Signed-off-by: Michael Jackson <[email protected]>

* DOC: Fix some python code snippets

Signed-off-by: Michael Jackson <[email protected]>

* BUG: Removes EbsdLib header dependency in CreateAMScanPaths.

It was never dependent on it anyways.

Signed-off-by: Michael Jackson <[email protected]>

* ENH: Update filter human names for surface meshing filters. Update Docs.

- Update QuickMesh and SurfaceNets surface meshing filter human names
- Update the documentation for each filter.

Signed-off-by: Michael Jackson <[email protected]>

* BUG: Broken external links for the SimplnxCore filters within the python docs

Signed-off-by: Michael Jackson <[email protected]>
(cherry picked from commit 41ee443)

* Improve error message for missing parameter version key

(cherry picked from commit 75f2321)

---------

Signed-off-by: Michael Jackson <[email protected]>
Co-authored-by: Jessica Marquis <[email protected]>
  • Loading branch information
imikejackson and jmarquisbq authored Nov 23, 2024
1 parent ace11c0 commit bae5244
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 21 deletions.
4 changes: 4 additions & 0 deletions cmake/Summary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ message(STATUS "* SIMPLNX_ENABLE_PACKAGING: ${SIMPLNX_ENABLE_PACKAGING}")
message(STATUS "* SIMPLNX_BUILD_DOCS: ${SIMPLNX_BUILD_DOCS}")
message(STATUS "* DREAM3D_DATA_DIR: ${DREAM3D_DATA_DIR}")


message(STATUS "* -------------- Simplnx Python Configuration Options -------------------------------------")
message(STATUS "* Pybind11 (${pybind11_VERSION}) ${pybind11_DIR}")
message(STATUS "* Python3_EXECUTABLE: ${Python3_EXECUTABLE}")
Expand All @@ -87,7 +88,10 @@ message(STATUS "* SIMPLNX_EMBED_PYTHON: ${SIMPLNX_EMBED_PYTHON}")
# message(STATUS "* SIMPLNX_PLUGIN_ENABLE_${plugin}: ${SIMPLNX_PLUGIN_ENABLE_${plugin}}")
# endforeach()


message(STATUS "* -------------- Plugins ------------------------------------------------------")
message(STATUS "* SIMPLNX_ENABLE_OrientationAnalysis: ${SIMPLNX_ENABLE_OrientationAnalysis}")

get_property(simplnxPluginTargets GLOBAL PROPERTY simplnxPluginTargets)
foreach(d3dPlugin ${SIMPLNX_PLUGIN_LIST})
get_property(PluginNumFilters GLOBAL PROPERTY ${d3dPlugin}_filter_count)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "simplnx/DataStructure/DataPath.hpp"
#include "simplnx/DataStructure/Geometry/ImageGeom.hpp"
#include "simplnx/Filter/Actions/CreateArrayAction.hpp"
#include "simplnx/Filter/Actions/CreateAttributeMatrixAction.hpp"
#include "simplnx/Filter/Actions/CreateDataGroupAction.hpp"
#include "simplnx/Filter/Actions/CreateImageGeometryAction.hpp"
#include "simplnx/Filter/Actions/CreateStringArrayAction.hpp"
Expand Down Expand Up @@ -175,14 +176,14 @@ IFilter::PreflightResult ReadAngDataFilter::preflightImpl(const DataStructure& d
}

// Create the Ensemble AttributeMatrix
std::vector<std::shared_ptr<AngPhase>> angPhases = reader.getPhaseVector();
tupleDims = {angPhases.size() + 1}; // Always create 1 extra slot for the phases.
DataPath ensembleAttributeMatrixPath = pImageGeometryPath.createChildPath(pCellEnsembleAttributeMatrixNameValue);
{
auto createDataGroupAction = std::make_unique<CreateDataGroupAction>(ensembleAttributeMatrixPath);
resultOutputActions.value().appendAction(std::move(createDataGroupAction));
auto createAttributeMatrixAction = std::make_unique<CreateAttributeMatrixAction>(ensembleAttributeMatrixPath, tupleDims);
resultOutputActions.value().appendAction(std::move(createAttributeMatrixAction));
}

std::vector<std::shared_ptr<AngPhase>> angPhases = reader.getPhaseVector();
tupleDims = {angPhases.size() + 1}; // Always create 1 extra slot for the phases.
// Create the Crystal Structures Array
{
cDims[0] = 1;
Expand Down
14 changes: 13 additions & 1 deletion src/Plugins/SimplnxCore/docs/QuickSurfaceMeshFilter.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Quick Surface Mesh
# Create Surface Mesh (QuickMesh Nets)

## Group (Subgroup)

Surface Meshing (Generation)

## Deprecation Notice

The "SurfaceNets" filter should be used instead. Search the filter list for "Surface Nets".

## Description

This **Filter** generates a **Triangle Geometry** from a grid **Geometry** (either an **Image Geometry** or a **RectGrid Geometry**) that represents a surface mesh of the present **Features**. The algorithm proceeds by creating a pair of **Triangles** for each face of the **Cell** where the neighboring **Cells** have a different **Feature** Id value. The meshing operation is extremely quick but can result in a surface mesh that is very "stair stepped". The user is encouraged to use a smoothing operation to reduce this "blockiness".
Expand Down Expand Up @@ -59,6 +63,14 @@ One of the arrays to come out of the algorithm is the "Node Type" vertex array.
| 13 | Node that is on the exterior of the mesh and is a triple line |
| 14 | Node that is on the exterior of the mesh and is a quadruple point |

## Notes

The Quickmesh algorithm is very crude and naive in its implementation. This filter
along with the Laplacian Smoothing filter can give you reasonable results. The
newer filter that should replace both the quick mesh and the Laplacian Smoothing
filter is the "SurfaceNets" surface meshing algorithm. This will create the surface
mesh and smooth in a single filter and give subjectively better results.

% Auto generated parameter table will be inserted here

## Example Pipelines
Expand Down
7 changes: 6 additions & 1 deletion src/Plugins/SimplnxCore/docs/SurfaceNetsFilter.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SurfaceNets Meshing Filter
# Create Surface Mesh (Surface Nets)

## Group (Subgroup)

Expand Down Expand Up @@ -58,6 +58,11 @@ Nodes that appear on the exterior of a volume have Node Type values starting at

![Exterior Node Types](Images/SurfaceNets_NodeType_Exterior.png)

## Notes

This filter should be used in place of the "QuickMesh Surface Filter".


% Auto generated parameter table will be inserted here

## Example Pipelines
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#include "simplnx/DataStructure/Geometry/EdgeGeom.hpp"
#include "simplnx/Utilities/ImageRotationUtilities.hpp"

#include <EbsdLib/Core/Orientation.hpp>

using namespace nx::core;

namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Uuid QuickSurfaceMeshFilter::uuid() const
//------------------------------------------------------------------------------
std::string QuickSurfaceMeshFilter::humanName() const
{
return "Quick Surface Mesh";
return "Create Surface Mesh (QuickMesh Nets)";
}

//------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ Uuid SurfaceNetsFilter::uuid() const
//------------------------------------------------------------------------------
std::string SurfaceNetsFilter::humanName() const
{
return "SurfaceNets Meshing Filter";
return "Create Surface Mesh (Surface Nets)";
}

//------------------------------------------------------------------------------
std::vector<std::string> SurfaceNetsFilter::defaultTags() const
{
return {"Surface Meshing", "Generation"};
return {className(), "Surface Meshing", "Generation", "Create", "Triangle", "Geometry"};
}

//------------------------------------------------------------------------------
Parameters SurfaceNetsFilter::parameters() const
{
Parameters params;
params.insertSeparator(Parameters::Separator{"Input Parameter(s)"});
params.insertLinkableParameter(std::make_unique<BoolParameter>(k_ApplySmoothing_Key, "Apply smoothing operations", "Use the built in smmothing operation.", false));
params.insertLinkableParameter(std::make_unique<BoolParameter>(k_ApplySmoothing_Key, "Apply smoothing operations", "Use the built in smoothing operation.", false));

params.insert(std::make_unique<Int32Parameter>(k_SmoothingIterations_Key, "Relaxation Iterations", "Number of relaxation iterations to perform. More iterations causes more smoothing.", 20));
params.insert(
Expand Down
2 changes: 1 addition & 1 deletion src/simplnx/Filter/IParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Result<std::any> IParameter::fromJson(const nlohmann::json& json) const
}
else
{
warnings.push_back(Warning{-1, fmt::format("{}: Parameter key '{}' does not exist. Assuming version={}", name(), k_VersionKey, version)});
warnings.push_back(Warning{-1, fmt::format("{}: Parameter key '{}' does not exist. Assuming version={}. To fix this, save the pipeline file.", name(), k_VersionKey, version)});
}

nlohmann::json valueJson;
Expand Down
10 changes: 5 additions & 5 deletions src/simplnx/Parameters/FileSystemPathParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Result<> ValidateInputFile(const FileSystemPathParameter::ValueType& path)
}
} catch(const fs::filesystem_error& exception)
{
return MakeErrorResult(-9, fmt::format("Filesystem excpetion: {}", exception.what()));
return MakeErrorResult(-9, fmt::format("Filesystem exception: {}", exception.what()));
}
return {};
}
Expand All @@ -59,7 +59,7 @@ Result<> ValidateInputDir(const FileSystemPathParameter::ValueType& path)
}
} catch(const fs::filesystem_error& exception)
{
return MakeErrorResult(-10, fmt::format("Filesystem excpetion: {}", exception.what()));
return MakeErrorResult(-10, fmt::format("Filesystem exception: {}", exception.what()));
}

return {};
Expand All @@ -86,7 +86,7 @@ Result<> ValidateOutputFile(const FileSystemPathParameter::ValueType& path)
}
} catch(const fs::filesystem_error& exception)
{
return MakeErrorResult(-11, fmt::format("Filesystem excpetion: {}", exception.what()));
return MakeErrorResult(-11, fmt::format("Filesystem exception: {}", exception.what()));
}

return {};
Expand All @@ -108,7 +108,7 @@ Result<> ValidateOutputDir(const FileSystemPathParameter::ValueType& path)
}
} catch(const fs::filesystem_error& exception)
{
return MakeErrorResult(-12, fmt::format("Filesystem excpetion: {}", exception.what()));
return MakeErrorResult(-12, fmt::format("Filesystem exception: {}", exception.what()));
}
return {};
}
Expand Down Expand Up @@ -265,7 +265,7 @@ Result<> FileSystemPathParameter::validatePath(const ValueType& path) const
}
} catch(const fs::filesystem_error& exception)
{
return MakeErrorResult(-9, fmt::format("Filesystem excpetion: {}", exception.what()));
return MakeErrorResult(-9, fmt::format("Filesystem exception: {}", exception.what()));
}

return {};
Expand Down
3 changes: 2 additions & 1 deletion wrapping/python/docs/generate_sphinx_docs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ void GeneratePythonRstFiles()
for(const auto& plugin : pluginListPtr)
{
std::string plugName = plugin->getName();
std::string fullPluginName = plugName;
const std::string pluginRootDir = fmt::format("{}", s_PluginDirMap[plugName]);
if(pluginRootDir.empty())
{
Expand Down Expand Up @@ -711,7 +712,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("{}/{}/{}/{}.html", k_WebServerAddress, k_WebServerFilterFolder, plugName, filterClassName);
const std::string webAddress = fmt::format("{}/{}/{}/{}.html", k_WebServerAddress, k_WebServerFilterFolder, fullPluginName, filterClassName);
rstStream << " `Link to the full online documentation for " << filterClassName << " <" << webAddress << ">`_ \n\n";

const auto& parameters = filter->parameters();
Expand Down
2 changes: 1 addition & 1 deletion wrapping/python/docs/source/Python_Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ In order to import a .dream3d file, we need to tell **simplnx** which data to im
# import EVERY piece of data from the file.
import_data.data_paths = None
# Instantiate and execte the filter immediately.
result = nx.ReadDREAM3DFilter.execute(data_structure=data_structure, import_file_data=import_data)
result = nx.ReadDREAM3DFilter.execute(data_structure=data_structure, import_data_object=import_data)
# Check for any execution warnings or errors
if len(result.errors) != 0:
print('Errors: {}', result.errors)
Expand Down
2 changes: 1 addition & 1 deletion wrapping/python/docs/source/User_API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ General Parameters
import_data = nx.Dream3dImportParameter.ImportData()
import_data.file_path = "/private/tmp/basic_ebsd.dream3d"
import_data.data_paths = None
result = nx.ReadDREAM3DFilter.execute(data_structure=data_structure, import_file_data=import_data)
result = nx.ReadDREAM3DFilter.execute(data_structure=data_structure, import_data_object=import_data)
.. _DynamicTableParameter:
.. py:class:: DynamicTableParameter
Expand Down

0 comments on commit bae5244

Please sign in to comment.