Skip to content

Commit

Permalink
Merge pull request #249 from inviwo/feature/includeopt
Browse files Browse the repository at this point in the history
Feature/includeopt
  • Loading branch information
petersteneteg authored Feb 10, 2025
2 parents b58bfa2 + e6565bd commit a16fe4d
Show file tree
Hide file tree
Showing 52 changed files with 253 additions and 145 deletions.
111 changes: 94 additions & 17 deletions .github/workflows/modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,39 +199,53 @@ jobs:
name: inviwo-python-api
path: build/docs/python-api/*

- name: "Setup tmate session (on failure and debug_enabled)"
if: "${{ failure() && contains( github.event.pull_request.labels.*.name, 'CI: Debug') }}"
uses: mxschmitt/action-tmate@v3
timeout-minutes: 30
with:
limit-access-to-actor: true

- name: "Upload Vcpkg build Logs"
if: "${{ failure() }}"
uses: actions/upload-artifact@v4
with:
name: vcpkg-logs-${{ matrix.system }}-${{ matrix.linkage }}-${{ matrix.configuration }}
path: vcpkg/buildtrees/**/*.log

- name: "Setup tmate session (on failure and debug_enabled)"
if: "${{ failure() && contains( github.event.pull_request.labels.*.name, 'CI: Debug') }}"
uses: mxschmitt/action-tmate@v3
timeout-minutes: 30
with:
limit-access-to-actor: true

regression:
name: "Regression"
runs-on: [regression, macOS]
permissions:
pull-requests: write
timeout-minutes: 320
steps:

- name: "Clone Modules"
uses: actions/checkout@v4
with:
path: modules
submodules: false

- name: "Clone Inviwo"
uses: actions/checkout@v4
with:
repository: inviwo/inviwo
ref: master
path: inviwo
submodules: false

- name: "Get Vcpkg SHA"
shell: bash
run: |
SHA=`jq -r '.["vcpkg-configuration"].["default-registry"].baseline' inviwo/vcpkg.json`
echo "VCPKG_SHA=${SHA}" >> $GITHUB_ENV
- name: "VCPKG Update"
shell: bash
run: |
cd $VCPKG_INSTALLATION_ROOT
git fetch
git checkout $VCPKG_SHA
./bootstrap-vcpkg.sh
- name: Copy Preset
shell: bash
Expand Down Expand Up @@ -263,15 +277,17 @@ jobs:
echo "::remove-matcher owner=linker::"
- name: "Unit Tests"
id: unit_tests
continue-on-error: true
shell: bash
working-directory: "build"
continue-on-error: true
run: ctest -C RelWithDebInfo --output-on-failure

- name: "Integration Tests"
shell: bash
working-directory: "build/bin"
id: integration
continue-on-error: true
shell: bash
working-directory: "build/bin/RelWithDebInfo"
run: ./inviwo-integrationtests

- name: "Clone Regression"
Expand All @@ -283,8 +299,9 @@ jobs:
path: regression

- name: "Regression Tests"
shell: bash
id: regression
continue-on-error: true
shell: bash
run: |
mkdir -p regression/modules/macos/${{ github.ref }}
python3 inviwo/tools/regression.py \
Expand All @@ -306,6 +323,61 @@ jobs:
echo "### :chart_with_upwards_trend: Regression report at https://inviwo.org/regression/modules/macos/${{ github.ref }}/report.html " >> $GITHUB_STEP_SUMMARY
- name: Summary
if: "${{ github.ref != 'refs/heads/master' }}"
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.pull_request.number }}
UNIT_TESTS: "${{ steps.unit_tests.outcome }}"
INTEGRATION: ${{ steps.integration.outcome }}
REGRESSION: ${{ steps.regression.outcome }}
run: |
if [[ ${UNIT_TESTS} == "failure" ]]
then
gh pr edit "$NUMBER" --add-label "J: Unit Test Failure"
echo "### :bug: Unit Test Failure:bangbang: \n" >> $GITHUB_STEP_SUMMARY
fi
if [[ ${UNIT_TESTS} == "success" ]]
then
gh pr edit "$NUMBER" --remove-label "J: Unit Test Failure" || true
fi
if [[ ${INTEGRATION} == "failure" ]]
then
gh pr edit "$NUMBER" --add-label "J: Integration Test Failure"
echo "### :bug: Integration Test Failure:bangbang: \n" >> $GITHUB_STEP_SUMMARY
fi
if [[ ${INTEGRATION} == "success" ]]
then
gh pr edit "$NUMBER" --remove-label "J: Integration Test Failure" || true
fi
if [[ ${REGRESSION} == "failure" ]]
then
gh pr edit "$NUMBER" --add-label "J: Regression Test Failure"
echo "### :beetle: Regression Test Failure:bangbang: \n" >> $GITHUB_STEP_SUMMARY
fi
if [[ ${REGRESSION} == "success" ]]
then
gh pr edit "$NUMBER" --remove-label "J: Regression Test Failure" || true
fi
- name: Exit
shell: bash
env:
UNIT_TESTS: ${{ steps.unit_tests.outcome }}
INTEGRATION: ${{ steps.integration.outcome }}
REGRESSION: ${{ steps.regression.outcome }}
run: |
if [[ ${UNIT_TESTS} == "success" ]] && [[ ${INTEGRATION} == "success" ]] && [[ ${REGRESSION} == "success" ]]
then
exit 0
else
exit 1
fi
clang-tidy:
name: "Clang-tidy"
if: github.ref != 'refs/heads/master'
Expand All @@ -321,15 +393,13 @@ jobs:
uses: actions/checkout@v4
with:
path: modules
submodules: false

- name: "Clone Inviwo"
uses: actions/checkout@v4
with:
repository: inviwo/inviwo
ref: master
path: inviwo
submodules: false

- name: "Install dependencies"
uses: ./inviwo/.github/actions/install-dependencies
Expand Down Expand Up @@ -362,7 +432,7 @@ jobs:
-DVCPKG_MANIFEST_FEATURES="sgct;graphviz;openmesh;nanovg"
- name: "Run clang-tidy"
uses: cpp-linter/[email protected].2
uses: cpp-linter/[email protected].4
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -380,6 +450,13 @@ jobs:
thread-comments: update
file-annotations: false
verbosity: debug

- name: "Upload Vcpkg build Logs"
if: "${{ failure() }}"
uses: actions/upload-artifact@v4
with:
name: vcpkg-logs-clang-tidy
path: vcpkg/buildtrees/**/*.log

- name: "Setup tmate session (on failure and debug_enabled)"
if: "${{ failure() && contains( github.event.pull_request.labels.*.name, 'CI: Debug') }}"
Expand Down Expand Up @@ -483,7 +560,7 @@ jobs:
echo "${{ steps.changelog.outputs.changelog }}"
echo "-- End --"
- name: "Upload Changelog"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: changelog.md
path: changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace inviwo {
*/
class IVW_MODULE_DATAFRAMECLUSTERING_API DataFrameClustering : public Processor {
public:
DataFrameClustering(InviwoApplication* app);
DataFrameClustering();
virtual ~DataFrameClustering() = default;

virtual void process() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <inviwo/dataframeclustering/processors/dataframeclustering.h>
#include <inviwo/dataframeclustering/dataframeclusteringmodule.h>
#include <inviwo/core/util/moduleutils.h>
#include <modules/python3/pybindutils.h>

#include <inviwo/core/common/inviwoapplication.h>
Expand All @@ -46,7 +47,7 @@ const ProcessorInfo DataFrameClustering::processorInfo_{
};
const ProcessorInfo& DataFrameClustering::getProcessorInfo() const { return processorInfo_; }

DataFrameClustering::DataFrameClustering(InviwoApplication* app)
DataFrameClustering::DataFrameClustering()
: Processor()
, dataFrame_("dataFrame")
, newDataFrame_("newDataFrame")
Expand Down Expand Up @@ -87,7 +88,7 @@ DataFrameClustering::DataFrameClustering(InviwoApplication* app)

, columns_("columns", "Columns")
, script_(PythonScript::fromFile(
app->getModuleByType<DataFrameClusteringModule>()->getPath(ModulePath::Scripts) /
util::getModuleByType<DataFrameClusteringModule>()->getPath(ModulePath::Scripts) /
"dataframeclustering.py")) {

numberOfClusters_.setSerializationMode(PropertySerializationMode::All);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@ void EventLogger<Inport, Outport>::invokeEvent(Event* event) {
const auto it = eventMap_.find(event->hash());
if ((it == eventMap_.end() && enableOtherEvents_.get()) ||
(it != eventMap_.end() && it->second.get())) {
std::ostringstream oss;
event->print(oss);
log::info("Processor {:>15}: {}", getDisplayName(), oss.str());
log::info("{:25} {}", getDisplayName(), *event);
}
}

Expand Down
8 changes: 5 additions & 3 deletions misc/graphviz/src/graphvizsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ void calculateLayout(StrBuffer& buff, ProcessorNetwork* net, const Func& func) {
}

void layoutNetwork(ProcessorNetwork* net, glm::dvec2 sep, bool alignSources, bool alignSinks) {
if (!net) return;

StrBuffer buff;
createDotGraph(buff, net, sep, alignSources, alignSinks);

Expand Down Expand Up @@ -217,15 +219,15 @@ GraphvizSettings::GraphvizSettings(InviwoApplication* app)
print.onChange([this]() {
StrBuffer buff;
createDotGraph(buff, app_->getProcessorNetwork(), separation, alignSources, alignSinks);
LogInfo(buff.view());
log::report(LogLevel::Info, buff.view());
calculateLayout(buff, app_->getProcessorNetwork(), [](Processor* p, const dvec2 pos) {
dvec2 cpos{-1, -1};
if (auto* meta =
p->getMetaData<ProcessorMetaData>(ProcessorMetaData::classIdentifier)) {
cpos = meta->getPosition();
}
LogInfo(fmt::format("{:30} New: {:20} Snapped: {:20} Current: {:20}",
p->getIdentifier(), pos, snap(pos), cpos));
log::info("{:30} New: {:20} Snapped: {:20} Current: {:20}", p->getIdentifier(),
pos, snap(pos), cpos);
});
});

Expand Down
4 changes: 3 additions & 1 deletion misc/nanovgutils/include/inviwo/nanovgutils/nanovgcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include <nanovg.h>
#include <warn/pop>

#include <filesystem>

namespace inviwo {
class IVW_MODULE_NANOVGUTILS_API NanoVGContext {
friend class NanoVGUtilsModule;
Expand Down Expand Up @@ -318,7 +320,7 @@ class IVW_MODULE_NANOVGUTILS_API NanoVGContext {

template <>
struct EnumTraits<NanoVGContext::Alignment> {
static std::string name() { return "Text Alignment"; }
static constexpr std::string_view name() { return "Text Alignment"; }
};

} // namespace inviwo
2 changes: 1 addition & 1 deletion misc/nanovgutils/src/properties/nanovgfontproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ auto NanoVGFontProperty::get() const {
getFontBlur());
}

} // namespace inviwo
} // namespace inviwo
16 changes: 8 additions & 8 deletions misc/openmesh/src/utils/openmeshconverters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ void createVertexBuffers(TriMesh& mesh, const BasicMesh& inmesh, TransformCoordi
m = inmesh.getCoordinateTransformer().getDataToWorldMatrix();
}

for (const auto& [pos, normal, texCoord, color] :
for (const auto&& [pos, normal, texCoord, color] :
util::zip(vertices, normals, texCoords, colors)) {
auto i = [&](const auto& pos) {
auto i = [&](const auto& position) {
if (transform == TransformCoordinates::NoTransform) {
return mesh.add_vertex({pos.x, pos.y, pos.z});
return mesh.add_vertex({position.x, position.y, position.z});
} else {
auto pos4 = m * vec4{pos, 1};
auto pos4 = m * vec4{position, 1};
return mesh.add_vertex({pos4.x / pos4.w, pos4.y / pos4.w, pos4.z / pos4.w});
}
}(pos);
Expand All @@ -80,12 +80,12 @@ void createVertexBuffers(TriMesh& mesh, const SimpleMesh& inmesh, TransformCoord
m = inmesh.getCoordinateTransformer().getDataToWorldMatrix();
}

for (const auto& [pos, texCoord, color] : util::zip(vertices, texCoords, colors)) {
auto i = [&](const auto& pos) {
for (const auto&& [pos, texCoord, color] : util::zip(vertices, texCoords, colors)) {
auto i = [&](const auto& position) {
if (transform == TransformCoordinates::NoTransform) {
return mesh.add_vertex({pos.x, pos.y, pos.z});
return mesh.add_vertex({position.x, position.y, position.z});
} else {
auto pos4 = m * vec4{pos, 1};
auto pos4 = m * vec4{position, 1};
return mesh.add_vertex({pos4.x / pos4.w, pos4.y / pos4.w, pos4.z / pos4.w});
}
}(pos);
Expand Down
1 change: 1 addition & 0 deletions misc/vtk/src/ports/vtkinport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <inviwo/core/util/exception.h>
#include <inviwo/core/util/safecstr.h>
#include <inviwo/core/util/stdextensions.h>
#include <inviwo/core/util/docutils.h>
#include <inviwo/core/network/processornetwork.h>
#include <inviwo/core/processors/processor.h>

Expand Down
1 change: 1 addition & 0 deletions misc/vtk/src/ports/vtkoutport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include <inviwo/core/util/exception.h>
#include <inviwo/core/util/safecstr.h>
#include <inviwo/core/util/docutils.h>
#include <inviwo/core/network/processornetwork.h>
#include <inviwo/core/processors/processor.h>

Expand Down
Loading

0 comments on commit a16fe4d

Please sign in to comment.