• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

geo-engine / geoengine / 10699003826

04 Sep 2024 09:11AM UTC coverage: 91.003% (-0.1%) from 91.122%
10699003826

push

github

web-flow
Merge pull request #977 from geo-engine/model_db

db for ml models (wip)

460 of 843 new or added lines in 25 files covered. (54.57%)

21 existing lines in 9 files now uncovered.

133663 of 146878 relevant lines covered (91.0%)

52516.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/operators/src/pro/engine/execution_context.rs
1
use crate::engine::{
2
    CreateSpan, ExecutionContext, ExecutionContextExtensions, InitializedPlotOperator,
3
    InitializedRasterOperator, InitializedVectorOperator, MetaData, MetaDataProvider,
4
    MockExecutionContext, ResultDescriptor, WorkflowOperatorPath,
5
};
6
use crate::pro::meta::wrapper::InitializedOperatorWrapper;
7
use crate::util::Result;
8
use async_trait::async_trait;
9
use geoengine_datatypes::dataset::{DataId, NamedData};
10
use geoengine_datatypes::machine_learning::{MlModelMetadata, MlModelName};
11
use geoengine_datatypes::raster::TilingSpecification;
12
use geoengine_datatypes::util::test::TestDefault;
13
use rayon::ThreadPool;
14
use std::sync::Arc;
15

16
/// A mock execution context that wraps all operators with a statistics operator.
17
pub struct StatisticsWrappingMockExecutionContext {
18
    pub inner: MockExecutionContext,
19
}
20

21
impl TestDefault for StatisticsWrappingMockExecutionContext {
22
    fn test_default() -> Self {
×
23
        Self {
×
24
            inner: MockExecutionContext::test_default(),
×
25
        }
×
26
    }
×
27
}
28

29
#[async_trait::async_trait]
30
impl ExecutionContext for StatisticsWrappingMockExecutionContext {
31
    fn thread_pool(&self) -> &Arc<ThreadPool> {
×
32
        &self.inner.thread_pool
×
33
    }
×
34

35
    fn tiling_specification(&self) -> TilingSpecification {
×
36
        self.inner.tiling_specification
×
37
    }
×
38

39
    fn wrap_initialized_raster_operator(
×
40
        &self,
×
41
        op: Box<dyn InitializedRasterOperator>,
×
42
        span: CreateSpan,
×
43
        path: WorkflowOperatorPath,
×
44
    ) -> Box<dyn InitializedRasterOperator> {
×
45
        InitializedOperatorWrapper::new(op, span, path).boxed()
×
46
    }
×
47

48
    fn wrap_initialized_vector_operator(
×
49
        &self,
×
50
        op: Box<dyn InitializedVectorOperator>,
×
51
        span: CreateSpan,
×
52
        path: WorkflowOperatorPath,
×
53
    ) -> Box<dyn InitializedVectorOperator> {
×
54
        InitializedOperatorWrapper::new(op, span, path).boxed()
×
55
    }
×
56

57
    fn wrap_initialized_plot_operator(
×
58
        &self,
×
59
        op: Box<dyn InitializedPlotOperator>,
×
60
        _span: CreateSpan,
×
61
        _path: WorkflowOperatorPath,
×
62
    ) -> Box<dyn InitializedPlotOperator> {
×
63
        op
×
64
    }
×
65

66
    async fn resolve_named_data(&self, data: &NamedData) -> Result<DataId> {
×
67
        self.inner.resolve_named_data(data).await
×
68
    }
×
69

NEW
70
    async fn ml_model_metadata(&self, name: &MlModelName) -> Result<MlModelMetadata> {
×
NEW
71
        self.inner.ml_model_metadata(name).await
×
NEW
72
    }
×
73

74
    fn extensions(&self) -> &ExecutionContextExtensions {
×
75
        self.inner.extensions()
×
76
    }
×
77
}
78

79
#[async_trait]
80
impl<L, R, Q> MetaDataProvider<L, R, Q> for StatisticsWrappingMockExecutionContext
81
where
82
    L: 'static,
83
    R: 'static + ResultDescriptor,
84
    Q: 'static,
85
{
86
    async fn meta_data(&self, id: &DataId) -> Result<Box<dyn MetaData<L, R, Q>>> {
×
87
        self.inner.meta_data(id).await
×
88
    }
×
89
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc