< Summary

Line coverage
80%
Covered lines: 4
Uncovered lines: 1
Coverable lines: 5
Total lines: 114
Line coverage: 80%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

File(s)

C:\Users\Kremenchuk\actions-runner\_work\Holoflow\Holoflow\src\holotask\include\holotask\asyncs\slide_avg.hh

#LineLine coverage
 1// Copyright 2025 Digital Holography Foundation
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15#pragma once
 16
 17#include <nlohmann/json.hpp>
 18#include <span>
 19
 20#include "holoflow/core/tasks.hh"
 21
 22namespace holotask::asyncs {
 23
 24// -------------------------------------------------------------------------------------------------
 25// Settings
 26// -------------------------------------------------------------------------------------------------
 27
 28struct SlidingAverageSettings {
 29  size_t target_capacity;
 30  size_t window_size;
 31  size_t discard_first = 0;
 32
 33  bool operator==(const SlidingAverageSettings &) const = default;
 34};
 35
 36void to_json(nlohmann::json &j, const SlidingAverageSettings &s);
 37void from_json(const nlohmann::json &j, SlidingAverageSettings &s);
 38
 39// -------------------------------------------------------------------------------------------------
 40// Factory
 41// -------------------------------------------------------------------------------------------------
 42
 43class SlidingAverageFactory : public holoflow::core::IAsyncTaskFactory {
 44public:
 045  ~SlidingAverageFactory() override = default;
 46
 47  holoflow::core::InferResult infer(std::span<const holoflow::core::TDesc> input_descs,
 48                                    const nlohmann::json &jsettings) const override;
 49
 50  std::unique_ptr<holoflow::core::IAsyncTask>
 51  create(std::span<const holoflow::core::TDesc> input_descs, const nlohmann::json &jsettings,
 52         const holoflow::core::AsyncCreateCtx &ctx) const override;
 53
 54  std::unique_ptr<holoflow::core::IAsyncTask>
 55  update(std::unique_ptr<holoflow::core::IAsyncTask> old_task,
 56         std::span<const holoflow::core::TDesc> input_descs, const nlohmann::json &jsettings,
 57         const holoflow::core::AsyncCreateCtx &ctx) const override;
 58};
 59
 60} // namespace holotask::asyncs

C:\Users\Kremenchuk\actions-runner\_work\Holoflow\Holoflow\src\holotask\include\holotask\syncs\pca.hh

#LineLine coverage
 1// Copyright 2025 Digital Holography Foundation
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6//
 7//     http://www.apache.org/licenses/LICENSE-2.0
 8//
 9// Unless required by applicable law or agreed to in writing, software
 10// distributed under the License is distributed on an "AS IS" BASIS,
 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15#pragma once
 16
 17#include <memory>
 18#include <nlohmann/json.hpp>
 19#include <span>
 20
 21#include "holoflow/core/tasks.hh"
 22
 23namespace holotask::syncs {
 24
 25struct PcaSettings {
 26  int begin;
 27  int end;
 28
 129  int components() const { return end - begin; }
 30
 131  bool operator==(const PcaSettings &other) const {
 132    return begin == other.begin && end == other.end;
 133  }
 34};
 35
 36void to_json(nlohmann::json &j, const PcaSettings &settings);
 37void from_json(const nlohmann::json &j, PcaSettings &settings);
 38
 39class PcaFactory : public holoflow::core::ISyncTaskFactory {
 40public:
 41  holoflow::core::InferResult infer(std::span<const holoflow::core::TDesc> input_descs,
 42                                    const nlohmann::json &jsettings) const override;
 43
 44  std::unique_ptr<holoflow::core::ISyncTask>
 45  create(std::span<const holoflow::core::TDesc> input_descs, const nlohmann::json &jsettings,
 46         const holoflow::core::SyncCreateCtx &ctx) const override;
 47
 48  std::unique_ptr<holoflow::core::ISyncTask>
 49  update(std::unique_ptr<holoflow::core::ISyncTask> old_task,
 50         std::span<const holoflow::core::TDesc> input_descs, const nlohmann::json &jsettings,
 51         const holoflow::core::SyncCreateCtx &ctx) const override;
 52};
 53
 54} // namespace holotask::syncs

Methods/Properties