diff --git a/CMakeLists.txt b/CMakeLists.txt index fc7f8e7446..3538c206be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -786,13 +786,18 @@ endif() if(COMPLEX_ENABLE_OrientationAnalysis) set(COMPLEX_PLUGIN_LIST ${COMPLEX_PLUGIN_LIST} OrientationAnalysis) endif() + +if(COMPLEX_BUILD_TESTS) + list(APPEND COMPLEX_PLUGIN_LIST TestOne TestTwo) +endif() + # Add any plugins to the list set(COMPLEX_PLUGIN_LIST ${COMPLEX_PLUGIN_LIST} ${COMPLEX_EXTRA_PLUGINS}) foreach(plugin ${COMPLEX_PLUGIN_LIST}) - if(NOT DEFINED COMPLEX_ENABLE_${plugin}) - set(COMPLEX_ENABLE_${plugin} ON) + if(NOT DEFINED COMPLEX_PLUGIN_ENABLE_${plugin}) + set(COMPLEX_PLUGIN_ENABLE_${plugin} ON) endif() complex_add_plugin(PLUGIN_NAME ${plugin}) endforeach() diff --git a/cmake/Summary.cmake b/cmake/Summary.cmake index 32a18ff504..5f2e314a03 100644 --- a/cmake/Summary.cmake +++ b/cmake/Summary.cmake @@ -37,6 +37,12 @@ endfunction() #------------------------------------------------------------------------------------ # Print out a Summary Section: message(STATUS "* ============= COMPLEX Configuration Summary ===============") +set(ALL_PROJECTS complex) +foreach(proj ${ALL_PROJECTS}) + # cmpGitRevisionString(PROJECT_NAME ${proj}) + get_property(githash GLOBAL PROPERTY ${proj}_GIT_HASH) + message(STATUS "* ${proj}: ${${proj}_SOURCE_DIR} Git Hash: ${githash}") +endforeach() message(STATUS "* BUILD_TYPE: ${CMAKE_BUILD_TYPE}") message(STATUS "* COMPLEX: ${complex_VERSION}") OSInformation() @@ -55,36 +61,29 @@ message(STATUS "* nod (${nod_VERSION}) ${nod_DIR}") message(STATUS "* reproc++ (${reproc_VERSION}) ${reproc++_DIR}") message(STATUS "* -------------- Complex Configuration Options -------------------------------------") -message(STATUS "* COMPLEX_BUILD_PYTHON: ${COMPLEX_BUILD_PYTHON}") -message(STATUS "* Python3_EXECUTABLE: ${Python3_EXECUTABLE}") -message(STATUS "* MKDOCS_EXECUTABLE: ${MKDOCS_EXECUTABLE}") - -message(STATUS "* COMPLEX_EMBED_PYTHON: ${COMPLEX_EMBED_PYTHON}") message(STATUS "* COMPLEX_BUILD_TESTS: ${COMPLEX_BUILD_TESTS}") message(STATUS "* COMPLEX_ENABLE_MULTICORE: ${COMPLEX_ENABLE_MULTICORE}") message(STATUS "* COMPLEX_ENABLE_COMPRESSORS: ${COMPLEX_ENABLE_COMPRESSORS}") message(STATUS "* COMPLEX_DOWNLOAD_TEST_FILES: ${COMPLEX_DOWNLOAD_TEST_FILES}") message(STATUS "* COMPLEX_WRITE_TEST_OUTPUT: ${COMPLEX_WRITE_TEST_OUTPUT}") - -get_property(ComplexPluginTargets GLOBAL PROPERTY ComplexPluginTargets) -foreach(d3dPlugin ${ComplexPluginTargets}) - message(STATUS "* COMPLEX_ENABLE_${d3dPlugin}: ${COMPLEX_ENABLE_${d3dPlugin}}") -endforeach() - message(STATUS "* COMPLEX_ENABLE_LINK_FILESYSTEM: ${COMPLEX_ENABLE_LINK_FILESYSTEM}") message(STATUS "* COMPLEX_ENABLE_INSTALL: ${COMPLEX_ENABLE_INSTALL}") message(STATUS "* COMPLEX_ENABLE_PACKAGING: ${COMPLEX_ENABLE_PACKAGING}") message(STATUS "* COMPLEX_BUILD_DOCS: ${COMPLEX_BUILD_DOCS}") message(STATUS "* DREAM3D_DATA_DIR: ${DREAM3D_DATA_DIR}") -set(ALL_PROJECTS complex) -foreach(proj ${ALL_PROJECTS}) - # cmpGitRevisionString(PROJECT_NAME ${proj}) - get_property(githash GLOBAL PROPERTY ${proj}_GIT_HASH) - message(STATUS "* ${proj}: ${${proj}_SOURCE_DIR} Git Hash: ${githash}") +message(STATUS "* -------------- Complex Python Configuration Options -------------------------------------") +message(STATUS "* COMPLEX_BUILD_PYTHON: ${COMPLEX_BUILD_PYTHON}") +message(STATUS "* COMPLEX_EMBED_PYTHON: ${COMPLEX_EMBED_PYTHON}") +message(STATUS "* Python3_EXECUTABLE: ${Python3_EXECUTABLE}") +message(STATUS "* MKDOCS_EXECUTABLE: ${MKDOCS_EXECUTABLE}") + +message(STATUS "* -------------- Known Plugins ------------------------------------------------------") +foreach(plugin ${COMPLEX_PLUGIN_LIST}) + message(STATUS "* COMPLEX_PLUGIN_ENABLE_${plugin}: ${COMPLEX_PLUGIN_ENABLE_${plugin}}") endforeach() -message(STATUS "* -------------- Plugins ------------------------------------------------------") +message(STATUS "* -------------- Active Plugins ------------------------------------------------------") get_property(ComplexPluginTargets GLOBAL PROPERTY ComplexPluginTargets) foreach(d3dPlugin ${ComplexPluginTargets}) get_property(PluginNumFilters GLOBAL PROPERTY ${d3dPlugin}_filter_count) @@ -93,4 +92,5 @@ foreach(d3dPlugin ${ComplexPluginTargets}) get_property(PluginDocsEnabled GLOBAL PROPERTY ${d3dPlugin}_docs_enabled) message(STATUS "* ${d3dPlugin}: [${COMPLEX_PLUGIN_ENABLE_${d3dPlugin}}] ${PluginNumFilters} Filters Docs:[${PluginDocsEnabled}]") endforeach() + message(STATUS "* ======================================================================") diff --git a/conda/bld.bat b/conda/bld.bat index c7eefe59ff..7afdf68ba7 100644 --- a/conda/bld.bat +++ b/conda/bld.bat @@ -1,6 +1,14 @@ +:: **************************************************************************** +:: This script file builds the necessary dependencies that are not found as +:: part of a python environment but are needed to ultimately build the +:: complex python bindings. +:: **************************************************************************** + mkdir sdk -rem "H5Support" +:: **************************************************************************** +:: Build the H5Support library +:: **************************************************************************** mkdir h5support_build cd h5support_build @@ -30,7 +38,9 @@ if errorlevel 1 exit 1 cd .. -rem "EbsdLib" +:: **************************************************************************** +:: Build the EbsdLib library +:: **************************************************************************** mkdir ebsdlib_build cd ebsdlib_build @@ -59,7 +69,9 @@ if errorlevel 1 exit 1 cd .. -rem "expected-lite" +:: **************************************************************************** +:: Build the expected-light library +:: **************************************************************************** mkdir expected-lite_build cd expected-lite_build @@ -80,7 +92,9 @@ if errorlevel 1 exit 1 cd .. -rem "span-lite" +:: **************************************************************************** +:: Build the span-light library +:: **************************************************************************** mkdir span-lite_build cd span-lite_build @@ -101,7 +115,9 @@ if errorlevel 1 exit 1 cd .. -rem "nod" +:: **************************************************************************** +:: Build the nod library +:: **************************************************************************** mkdir nod_build cd nod_build @@ -118,9 +134,25 @@ if errorlevel 1 exit 1 cmake --build . --target install if errorlevel 1 exit 1 + +:: **************************************************************************** +:: Install the EbsdLibrary into the python build environment so that stubgen +:: has access to it. +:: **************************************************************************** cd .. +cd ebsdlib_build + +cmake -D CMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" . +if errorlevel 1 exit 1 -rem "complex" +cmake --build . --target install +if errorlevel 1 exit 1 + +cd .. + +:: **************************************************************************** +:: Build the complex library +:: **************************************************************************** mkdir build cd build @@ -134,11 +166,3 @@ if errorlevel 1 exit 1 cmake --build . --target install if errorlevel 1 exit 1 -cd .. -cd ebsdlib_build - -cmake -D CMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" . -if errorlevel 1 exit 1 - -cmake --build . --target install -if errorlevel 1 exit 1 diff --git a/conda/recipe.yaml b/conda/recipe.yaml index 89d02688a0..b35ee8d280 100644 --- a/conda/recipe.yaml +++ b/conda/recipe.yaml @@ -42,7 +42,7 @@ requirements: - ninja - git host: - - "python {{ python }}" + - python - mypy - numpy >=1.16 - boost_mp11 diff --git a/src/Plugins/TestOne/CMakeLists.txt b/src/Plugins/TestOne/CMakeLists.txt index 44f6bd51d2..3b7d289a83 100644 --- a/src/Plugins/TestOne/CMakeLists.txt +++ b/src/Plugins/TestOne/CMakeLists.txt @@ -1,6 +1,8 @@ include("${complex_SOURCE_DIR}/cmake/Plugin.cmake") set(PLUGIN_NAME "TestOne") +set(${PLUGIN_NAME}_SOURCE_DIR ${complex_SOURCE_DIR}/src/Plugins/${PLUGIN_NAME}) + #------------------------------------------------------------------------------ # These are all the filters in the plugin. All filters should be kept in the # PLUGIN_NAME/src/PLUGIN_NAME/Filters/ directory. @@ -15,7 +17,7 @@ set(FilterList create_complex_plugin(NAME ${PLUGIN_NAME} FILTER_LIST ${FilterList} - DESCRIPTION "Plugin for Comp${PLUGIN_NAME}lexCore" + DESCRIPTION "Test Plugin for ${PLUGIN_NAME}" VERSION "0.1.0" ) diff --git a/src/Plugins/TestTwo/CMakeLists.txt b/src/Plugins/TestTwo/CMakeLists.txt index 792766edfb..273b85ea1b 100644 --- a/src/Plugins/TestTwo/CMakeLists.txt +++ b/src/Plugins/TestTwo/CMakeLists.txt @@ -1,6 +1,8 @@ include("${complex_SOURCE_DIR}/cmake/Plugin.cmake") set(PLUGIN_NAME "TestTwo") +set(${PLUGIN_NAME}_SOURCE_DIR ${complex_SOURCE_DIR}/src/Plugins/${PLUGIN_NAME}) + #------------------------------------------------------------------------------ # These are all the filters in the plugin. All filters should be kept in the # PLUGIN_NAME/src/PLUGIN_NAME/Filters/ directory. @@ -10,7 +12,7 @@ set(FilterList create_complex_plugin(NAME ${PLUGIN_NAME} FILTER_LIST ${FilterList} - DESCRIPTION "Plugin for Comp${PLUGIN_NAME}lexCore" + DESCRIPTION "Test Plugin for ${PLUGIN_NAME}" VERSION "0.1.0" ) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d4adc9015a..0c6baef92d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -14,11 +14,6 @@ find_package(Catch2 CONFIG REQUIRED) include(Catch) -get_property(COMPLEX_PLUGIN_COUNT GLOBAL PROPERTY COMPLEX_PLUGIN_COUNT) -add_subdirectory(${complex_SOURCE_DIR}/src/Plugins/TestOne ${complex_BINARY_DIR}/Plugins/TestOne) -add_subdirectory(${complex_SOURCE_DIR}/src/Plugins/TestTwo ${complex_BINARY_DIR}/Plugins/TestTwo) -MATH(EXPR COMPLEX_PLUGIN_COUNT "${COMPLEX_PLUGIN_COUNT}+2") - add_subdirectory(UnitTestCommon) add_executable(complex_test @@ -51,9 +46,21 @@ target_link_libraries(complex_test complex::UnitTestCommon ) +#------------------------------------------------------------------------------ # Require that the test plugins are built before tests because some tests # require loading from those plugins but don't want to link to them. -add_dependencies(complex_test TestOne TestTwo) +get_property(COMPLEX_PLUGIN_COUNT GLOBAL PROPERTY COMPLEX_PLUGIN_COUNT) + +#------------------------------------------------------------------------------ +# Create dependencies with complex_test on each of the test plugins +#------------------------------------------------------------------------------ +if(COMPLEX_PLUGIN_ENABLE_TestOne) + add_dependencies(complex_test TestOne) +endif() + +if(COMPLEX_PLUGIN_ENABLE_TestTwo) + add_dependencies(complex_test TestTwo) +endif() set_target_properties(complex_test PROPERTIES diff --git a/test/PluginTest.cpp b/test/PluginTest.cpp index 10aed296ed..286848ef91 100644 --- a/test/PluginTest.cpp +++ b/test/PluginTest.cpp @@ -31,6 +31,16 @@ TEST_CASE("Test Loading Plugins") const auto& filterHandles = filterList->getFilterHandles(); auto plugins = filterList->getLoadedPlugins(); + if(plugins.size() != COMPLEX_PLUGIN_COUNT) + { + std::cout << "Incorrect number of plugins were loaded.\n" + << "Expected: " << COMPLEX_PLUGIN_COUNT << "\nLoaded: " << plugins.size() << "\nLoaded Plugins are:\n"; + for(auto const& plugin : plugins) + { + std::cout << plugin->getName() << std::endl; + } + } + REQUIRE(plugins.size() == COMPLEX_PLUGIN_COUNT); REQUIRE(filterHandles.size() >= 2); @@ -62,6 +72,15 @@ TEST_CASE("Test Singleton") auto plugins = filterList->getLoadedPlugins(); // Check plugins were loaded + if(plugins.size() != COMPLEX_PLUGIN_COUNT) + { + std::cout << "Incorrect number of plugins were loaded.\n" + << "Expected: " << COMPLEX_PLUGIN_COUNT << "\nLoaded: " << plugins.size() << "\nLoaded Plugins are:\n"; + for(auto const& plugin : plugins) + { + std::cout << plugin->getName() << std::endl; + } + } REQUIRE(plugins.size() == COMPLEX_PLUGIN_COUNT); // Check filters loaded diff --git a/wrapping/python/ReadMe.md b/wrapping/python/ReadMe.md index 241bc70898..fb1b7a7a8c 100644 --- a/wrapping/python/ReadMe.md +++ b/wrapping/python/ReadMe.md @@ -38,6 +38,13 @@ Create the package from the `complex` sources [user@host] $ cd complex/conda [user@host] $ conda build . +For faster environment solves mamba can also be used. + +``` +conda install boa +conda mambabuild --python 3.8|3.9|3.10 . +``` + ### Uploading to Anaconda.org [user@host] $ conda login diff --git a/wrapping/python/docs/generate_sphinx_docs.cpp b/wrapping/python/docs/generate_sphinx_docs.cpp index d697033e73..406787535a 100644 --- a/wrapping/python/docs/generate_sphinx_docs.cpp +++ b/wrapping/python/docs/generate_sphinx_docs.cpp @@ -353,6 +353,9 @@ void GenerateRstFilterDocs() IFilter::UniquePointer filter = filterListPtr->createFilter(filterHandle); // auto plugin = filterListPtr->getPlugin(filterHandle); + rstStream << filterClassName << "\n"; + rstStream << GenerateUnderline(filterClassName.size(), '-') << "\n\n"; + rstStream << ".. _" << filterClassName << ":\n"; rstStream << ".. py:class:: " << filterClassName << "\n\n"; @@ -399,18 +402,16 @@ void GenerateRstFilterDocs() } rstStream << '\n'; - rstStream << " .. py:method:: Execute("; + rstStream << " .. py:method:: Execute(data_structure"; std::stringstream memberStream; + memberStream << " :param complex.DataStructure data_structure: The DataStructure object that holds the data to be processed.\n"; size_t index = 0; for(const auto& parameterPair : parameters) { auto const& anyParameter = parameterPair.second; - if(index != 0) - { - rstStream << ", "; - } + rstStream << ", "; rstStream << parameterPair.first; memberStream << " :param " << s_ParameterMap[anyParameter->uuid()] << " " << anyParameter->name() << ": " << anyParameter->helpText() << "\n"; @@ -466,6 +467,10 @@ void GenerateIndexRstFile() for(const auto& plugin : pluginListPtr) { std::string plugName = plugin->getName(); + if(plugName == "TestOne" || plugName == "TestTwo") + { + continue; + } const std::string pluginRootDir = fmt::format("{}", s_PluginDirMap[plugName]); if(plugName == "ComplexCore") diff --git a/wrapping/python/examples/angle_conversion.py b/wrapping/python/examples/angle_conversion.py index 3bee0dc089..d95d9029f2 100644 --- a/wrapping/python/examples/angle_conversion.py +++ b/wrapping/python/examples/angle_conversion.py @@ -13,7 +13,7 @@ data_structure = cx.DataStructure() # Create a DataArray to copy the Euler Angles into array_path = cx.DataPath(['Euler Angles']) -result = cx.CreateDataArray.execute(data_structure, +result = cx.CreateDataArray.execute(data_structure=data_structure, numeric_type=cx.NumericType.float32, component_count=3, tuple_dimensions=[[99]],