opensysml 0.12.2.dev20261109__tar.gz → 0.12.2.dev20261111__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/PKG-INFO +1 -1
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/__init__.py +4 -3
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/_version.py +1 -1
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/capabilities.py +5 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/check.py +4 -1
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/connection.py +34 -9
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/exploration.py +46 -1
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/model.py +14 -5
- opensysml-0.12.2.dev20261111/opensysml/proto/sysml_pb2.py +521 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/proto/sysml_pb2.pyi +50 -12
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/proto/sysml_pb2_grpc.py +2 -3
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/query.py +6 -1
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/release-digests.json +6 -6
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/symbol.py +4 -1
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml.egg-info/PKG-INFO +1 -1
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_check.py +10 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_document.py +35 -1
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_explore.py +23 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_symbol.py +28 -0
- opensysml-0.12.2.dev20261109/opensysml/proto/sysml_pb2.py +0 -517
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/README.md +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/_dist.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/action_run.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/binary.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/conversion.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/diagnostic.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/document.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/edit.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/element_properties.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/engines.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/enumeration.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/errors.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/fmi_runner.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/generate.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/importcompare.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/instance.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/metamodel/__init__.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/metamodel/_generated.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/metamodel/_reader.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/metamodel/_runtime.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/proto/__init__.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/py.typed +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/runs.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/signing.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/sources.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/typed.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/typefacts.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/values.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml/verdict.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml.egg-info/SOURCES.txt +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml.egg-info/dependency_links.txt +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml.egg-info/entry_points.txt +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml.egg-info/requires.txt +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/opensysml.egg-info/top_level.txt +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/pyproject.toml +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/setup.cfg +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_analysis_integration.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_api.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_api_reference.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_auth.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_big_integer.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_binary.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_capabilities.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_check_version.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_complex.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_connection.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_conversion.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_diagnostic.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_edit.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_element_properties.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_engines.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_enumeration.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_errors.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_evaluate_subject.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_feature_values.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_feature_values_capability.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_fmi_runner.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_function.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_generate.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_generate_golden.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_generate_sources.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_import_compare.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_infinity.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_instance.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_integration.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_legacy_pysysml_placeholder.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_lifecycle.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_measurement_ref.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_metamodel.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_metamodel_reader.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_metamodel_toolkit.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_metamodel_typing.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_metaobject.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_metaobject_identity.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_migration.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_model.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_model_surface_integration.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_parse_sources.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_parser_warnings.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_performed_action_pin_shape.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_performed_action_unbound_input.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_performer.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_pin_release_checksums.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_quantity.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_query.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_rational.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_refresh_diagnostics.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_response_compression.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_runs.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_runtime.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_runtime_integration.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_schedule.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_set_tensor.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_signing.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_snapshot_version.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_stale_service.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_strict_and_lookup.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_strict_conformance.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_structured.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_sweep_integration.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_target.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_tool_dry_run.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_typed.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_undetermined.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_unnamed_children.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_unset.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_variation_metadata.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_verification.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_verification_arguments.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_verification_questions.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_version.py +0 -0
- {opensysml-0.12.2.dev20261109 → opensysml-0.12.2.dev20261111}/tests/test_wire_compat.py +0 -0
|
@@ -33,6 +33,7 @@ from opensysml.typefacts import (
|
|
|
33
33
|
)
|
|
34
34
|
from opensysml.capabilities import (
|
|
35
35
|
CAPABILITY_ELEMENT_PROPERTIES,
|
|
36
|
+
CAPABILITY_INLINE_DOCUMENT_QUERY,
|
|
36
37
|
CAPABILITY_RECORD_RUN,
|
|
37
38
|
CAPABILITY_RUNS,
|
|
38
39
|
CAPABILITY_SELF_CHECK,
|
|
@@ -64,7 +65,7 @@ from opensysml.verdict import (
|
|
|
64
65
|
AnalysisResult, CalcResult, CaseEvaluation, SweepRow, SweepTable, ToolDryRun, Validation,
|
|
65
66
|
Verdict, VerificationVerdict,
|
|
66
67
|
)
|
|
67
|
-
from opensysml.exploration import Exploration, Outcome
|
|
68
|
+
from opensysml.exploration import Coverage, CoverageEntry, Exploration, Outcome
|
|
68
69
|
from opensysml.action_run import ActionOutputs
|
|
69
70
|
from opensysml.engines import Bound, EngineInfo, Standing
|
|
70
71
|
from opensysml.runs import (
|
|
@@ -147,10 +148,10 @@ __all__ = [
|
|
|
147
148
|
"Verdict", "CalcResult", "AnalysisResult", "CaseEvaluation", "SweepRow", "SweepTable",
|
|
148
149
|
"ToolDryRun",
|
|
149
150
|
"Validation", "VerificationVerdict",
|
|
150
|
-
"Exploration", "Outcome", "ActionOutputs",
|
|
151
|
+
"Exploration", "Outcome", "ActionOutputs", "Coverage", "CoverageEntry",
|
|
151
152
|
"Bound", "EngineInfo", "Standing",
|
|
152
153
|
"QueryElement", "QueryError",
|
|
153
|
-
"ElementIdentity", "ElementProperties", "ElementProperty", "CAPABILITY_ELEMENT_PROPERTIES",
|
|
154
|
+
"ElementIdentity", "ElementProperties", "ElementProperty", "CAPABILITY_ELEMENT_PROPERTIES", "CAPABILITY_INLINE_DOCUMENT_QUERY",
|
|
154
155
|
"SourceDocument",
|
|
155
156
|
"DocumentEvent", "DocumentQueryError", "DocumentQueryResult", "DocumentRow",
|
|
156
157
|
"DocumentState", "DocumentVerdict", "ElementRef", "INFINITY", "ObjectRef",
|
|
@@ -68,6 +68,11 @@ CAPABILITY_OSLC_QUERY = "oslc_query"
|
|
|
68
68
|
#: typed rows. Without it the service refuses with ``UNIMPLEMENTED``.
|
|
69
69
|
CAPABILITY_DOCUMENT_QUERY = "document_query"
|
|
70
70
|
|
|
71
|
+
#: ``RunDocumentQueryRequest.inline_query``: a query expression run in place of
|
|
72
|
+
#: a named query, planned by the same compiler. Without it the service refuses
|
|
73
|
+
#: the field with ``UNIMPLEMENTED``.
|
|
74
|
+
CAPABILITY_INLINE_DOCUMENT_QUERY = "inline_document_query"
|
|
75
|
+
|
|
71
76
|
#: The ``RenderDocument`` RPC, which renders a named document to Markdown.
|
|
72
77
|
#: Without it the service refuses with ``UNIMPLEMENTED``.
|
|
73
78
|
CAPABILITY_RENDER_DOCUMENT = "render_document"
|
|
@@ -8,6 +8,7 @@ every violation, divergence and final outcome witnessed as a replay schedule.
|
|
|
8
8
|
from dataclasses import dataclass, field
|
|
9
9
|
|
|
10
10
|
from opensysml.engines import Standing
|
|
11
|
+
from opensysml.exploration import Coverage
|
|
11
12
|
|
|
12
13
|
#: The verdicts a check answers.
|
|
13
14
|
VERDICT_HOLDS = "holds"
|
|
@@ -123,11 +124,13 @@ class CheckSearch:
|
|
|
123
124
|
notes: tuple = field(default_factory=tuple)
|
|
124
125
|
scope: tuple = field(default_factory=tuple)
|
|
125
126
|
status: str = ""
|
|
127
|
+
coverage: Coverage = field(default_factory=Coverage)
|
|
126
128
|
|
|
127
129
|
@classmethod
|
|
128
130
|
def of(cls, pb):
|
|
129
131
|
return cls(int(pb.states), int(pb.moves), int(pb.max_depth), tuple(pb.bounds_hit), pb.horizon,
|
|
130
|
-
pb.horizon_set, pb.mass_bounded, tuple(pb.notes), tuple(pb.scope), pb.status
|
|
132
|
+
pb.horizon_set, pb.mass_bounded, tuple(pb.notes), tuple(pb.scope), pb.status,
|
|
133
|
+
Coverage.of(pb.coverage))
|
|
131
134
|
|
|
132
135
|
|
|
133
136
|
@dataclass(frozen=True)
|
|
@@ -17,6 +17,7 @@ from opensysml.action_run import ActionOutputs
|
|
|
17
17
|
from opensysml.binary import ensure_binary, resolve_latest_version
|
|
18
18
|
from opensysml.capabilities import (
|
|
19
19
|
CAPABILITY_ELEMENT_PROPERTIES,
|
|
20
|
+
CAPABILITY_INLINE_DOCUMENT_QUERY,
|
|
20
21
|
CAPABILITY_CONVERT_CHECK_DIAGNOSTICS,
|
|
21
22
|
CAPABILITY_CONVERT_COMPACT,
|
|
22
23
|
CAPABILITY_CONVERT_LIBRARY_STUBS,
|
|
@@ -113,7 +114,7 @@ from opensysml.document import (
|
|
|
113
114
|
from opensysml.edit import EditedDocument, error_for_failure, failure_name, referrers_of, result_of
|
|
114
115
|
from opensysml.importcompare import comparison_result, import_result
|
|
115
116
|
from opensysml.enumeration import EnumLiteral
|
|
116
|
-
from opensysml.exploration import Exploration, Outcome
|
|
117
|
+
from opensysml.exploration import Coverage, Exploration, Outcome
|
|
117
118
|
from opensysml.errors import (
|
|
118
119
|
AnalysisRunError,
|
|
119
120
|
ConnectionError,
|
|
@@ -2038,40 +2039,61 @@ class Connection:
|
|
|
2038
2039
|
raise ConversionError(response.error)
|
|
2039
2040
|
return element_properties_of(response)
|
|
2040
2041
|
|
|
2041
|
-
def run_document_query(self, model_hash, query_id, bindings=None):
|
|
2042
|
-
"""Run a
|
|
2042
|
+
def run_document_query(self, model_hash, query_id=None, bindings=None, inline_query=None):
|
|
2043
|
+
"""Run a document query, named or written in place, and answer its typed rows.
|
|
2043
2044
|
|
|
2044
2045
|
The query is the model's own — a calc def specializing
|
|
2045
2046
|
``DocumentQueries::Query`` — not the standard's Query object that
|
|
2046
|
-
:meth:`query` evaluates. See :mod:`opensysml.document`.
|
|
2047
|
+
:meth:`query` evaluates. See :mod:`opensysml.document`. Exactly one of
|
|
2048
|
+
``query_id`` and ``inline_query`` is given.
|
|
2047
2049
|
|
|
2048
2050
|
Args:
|
|
2049
2051
|
model_hash (str): Hash of the model holding the query
|
|
2050
|
-
query_id (str): Qualified name of the document query
|
|
2052
|
+
query_id (str, optional): Qualified name of the document query
|
|
2051
2053
|
bindings (Mapping, optional): Parameter name to a value or list of
|
|
2052
2054
|
values; an :class:`~opensysml.document.ElementRef` binds a
|
|
2053
2055
|
model element, an :class:`~opensysml.document.ObjectRef` an
|
|
2054
2056
|
object ``instantiate`` built, by id or by path
|
|
2057
|
+
inline_query (str, optional): A query expression run in place of
|
|
2058
|
+
a named query — the result expression of such a calc def,
|
|
2059
|
+
``Project(WhereType(Descendants(Named("Vehicles")),
|
|
2060
|
+
"PartUsage"), ("name", "mass"))`` — with the
|
|
2061
|
+
``DocumentQueries`` library in scope and the model's own names
|
|
2062
|
+
reachable; needs the ``inline_document_query`` capability
|
|
2055
2063
|
|
|
2056
2064
|
Returns:
|
|
2057
2065
|
DocumentQueryResult: Projected columns and typed rows, in the
|
|
2058
2066
|
engine's deterministic order
|
|
2059
2067
|
|
|
2060
2068
|
Raises:
|
|
2061
|
-
MissingCapabilityError: If the service cannot run document queries
|
|
2062
|
-
|
|
2069
|
+
MissingCapabilityError: If the service cannot run document queries,
|
|
2070
|
+
or inline ones
|
|
2071
|
+
InvalidRequestError: If the query is not one, a binding is wrong,
|
|
2072
|
+
or the inline expression does not parse or plan (the message
|
|
2073
|
+
positions the fault: ``inline query <line>:<column>``)
|
|
2063
2074
|
SymbolNotFoundError: If the model does not declare the query, or
|
|
2064
2075
|
an object binding names an object the model does not hold
|
|
2065
2076
|
ModelNotFoundError: If the model is no longer cached
|
|
2077
|
+
ValueError: If both or neither of ``query_id`` and
|
|
2078
|
+
``inline_query`` are given
|
|
2066
2079
|
"""
|
|
2080
|
+
if (query_id is None) == (inline_query is None):
|
|
2081
|
+
raise ValueError("run_document_query takes query_id or inline_query, not both and not neither")
|
|
2067
2082
|
require(
|
|
2068
2083
|
self.server_info(),
|
|
2069
2084
|
CAPABILITY_DOCUMENT_QUERY,
|
|
2070
2085
|
upgrade_remedy(CAPABILITY_DOCUMENT_QUERY),
|
|
2071
2086
|
)
|
|
2087
|
+
if inline_query is not None:
|
|
2088
|
+
require(
|
|
2089
|
+
self.server_info(),
|
|
2090
|
+
CAPABILITY_INLINE_DOCUMENT_QUERY,
|
|
2091
|
+
upgrade_remedy(CAPABILITY_INLINE_DOCUMENT_QUERY),
|
|
2092
|
+
)
|
|
2072
2093
|
request = sysml_pb2.RunDocumentQueryRequest(
|
|
2073
2094
|
model_hash=model_hash,
|
|
2074
|
-
query_id=query_id,
|
|
2095
|
+
query_id=query_id or "",
|
|
2096
|
+
inline_query=inline_query or "",
|
|
2075
2097
|
bindings=build_bindings(bindings),
|
|
2076
2098
|
)
|
|
2077
2099
|
if any(binding_holds_big_int(binding) for binding in request.bindings):
|
|
@@ -2093,7 +2115,9 @@ class Connection:
|
|
|
2093
2115
|
)
|
|
2094
2116
|
with translate_rpc_errors(
|
|
2095
2117
|
not_found=SymbolNotFoundError,
|
|
2096
|
-
unimplemented=self._capability_refusal(
|
|
2118
|
+
unimplemented=self._capability_refusal(
|
|
2119
|
+
(CAPABILITY_DOCUMENT_QUERY, CAPABILITY_INLINE_DOCUMENT_QUERY)
|
|
2120
|
+
),
|
|
2097
2121
|
):
|
|
2098
2122
|
response = self._stub.RunDocumentQuery(request)
|
|
2099
2123
|
return document_result(response)
|
|
@@ -2786,6 +2810,7 @@ class Connection:
|
|
|
2786
2810
|
probabilities_lower_bound=status.probabilities_lower_bound,
|
|
2787
2811
|
failed_linearizations=status.failed_linearizations,
|
|
2788
2812
|
unenumerated=list(status.unenumerated),
|
|
2813
|
+
coverage=Coverage.of(status.coverage),
|
|
2789
2814
|
)
|
|
2790
2815
|
|
|
2791
2816
|
def _outcome_of(self, pb):
|
|
@@ -11,9 +11,50 @@ an error outcome. Hitting a budget makes the :class:`Exploration` incomplete,
|
|
|
11
11
|
naming the budget; it is never an error.
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
|
+
from dataclasses import dataclass, field
|
|
15
|
+
|
|
14
16
|
from opensysml.errors import ExecutionError
|
|
15
17
|
|
|
16
18
|
|
|
19
|
+
@dataclass(frozen=True)
|
|
20
|
+
class CoverageEntry:
|
|
21
|
+
"""One state entered or one transition taken.
|
|
22
|
+
|
|
23
|
+
Attributes:
|
|
24
|
+
path (str): Qualified by the instance running the machine, such as
|
|
25
|
+
``Cov::Sys#1.m.run: viaA`` or ``Cov::Sys#1.m.run: s0 -> viaB``
|
|
26
|
+
declaration (str): Qualified by the declaration, such as
|
|
27
|
+
``Cov::M::run::viaA`` or ``Cov::M::run::s0 -> viaB``
|
|
28
|
+
runs (int): How many runs (schedules, under the check engine) did so
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
path: str
|
|
32
|
+
declaration: str
|
|
33
|
+
runs: int
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def of(cls, pb):
|
|
37
|
+
return cls(pb.path, pb.declaration, int(pb.runs))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@dataclass(frozen=True)
|
|
41
|
+
class Coverage:
|
|
42
|
+
"""What every run of an exploration, or every schedule of a check, entered and took.
|
|
43
|
+
|
|
44
|
+
Attributes:
|
|
45
|
+
states (tuple[CoverageEntry]): The states entered, by instance path
|
|
46
|
+
transitions (tuple[CoverageEntry]): The transitions taken, by instance path
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
states: tuple = field(default_factory=tuple)
|
|
50
|
+
transitions: tuple = field(default_factory=tuple)
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def of(cls, pb):
|
|
54
|
+
return cls(tuple(CoverageEntry.of(e) for e in pb.states),
|
|
55
|
+
tuple(CoverageEntry.of(e) for e in pb.transitions))
|
|
56
|
+
|
|
57
|
+
|
|
17
58
|
class Outcome:
|
|
18
59
|
"""One distinct outcome an exploration reached.
|
|
19
60
|
|
|
@@ -103,11 +144,14 @@ class Exploration:
|
|
|
103
144
|
unenumerated (list[str]): The constructs whose unordered alternatives
|
|
104
145
|
the runs took in one order without a choice point, by identifier —
|
|
105
146
|
empty when the exploration is complete
|
|
147
|
+
coverage (Coverage): Every state entered and transition taken over all
|
|
148
|
+
the runs, not only the witness of each outcome, with how many runs
|
|
149
|
+
did so
|
|
106
150
|
"""
|
|
107
151
|
|
|
108
152
|
def __init__(self, outcomes, complete, runs, budgets_hit, runs_budget,
|
|
109
153
|
depth_budget, probabilities_lower_bound=False,
|
|
110
|
-
failed_linearizations=0, unenumerated=None):
|
|
154
|
+
failed_linearizations=0, unenumerated=None, coverage=None):
|
|
111
155
|
self.outcomes = list(outcomes or [])
|
|
112
156
|
self.complete = complete
|
|
113
157
|
self.runs = runs
|
|
@@ -117,6 +161,7 @@ class Exploration:
|
|
|
117
161
|
self.probabilities_lower_bound = probabilities_lower_bound
|
|
118
162
|
self.failed_linearizations = failed_linearizations
|
|
119
163
|
self.unenumerated = list(unenumerated or [])
|
|
164
|
+
self.coverage = coverage if coverage is not None else Coverage()
|
|
120
165
|
|
|
121
166
|
def __iter__(self):
|
|
122
167
|
return iter(self.outcomes)
|
|
@@ -477,19 +477,25 @@ class Model:
|
|
|
477
477
|
oslc=oslc,
|
|
478
478
|
)
|
|
479
479
|
|
|
480
|
-
def run_document_query(self, query_id, bindings=None):
|
|
481
|
-
"""Run one of this model's named document queries.
|
|
480
|
+
def run_document_query(self, query_id=None, bindings=None, inline_query=None):
|
|
481
|
+
"""Run one of this model's named document queries, or a query expression.
|
|
482
482
|
|
|
483
483
|
The query is the model's own — a calc def specializing
|
|
484
484
|
``DocumentQueries::Query`` — not the standard's Query object
|
|
485
|
-
:meth:`query` evaluates. See :mod:`opensysml.document`.
|
|
485
|
+
:meth:`query` evaluates. See :mod:`opensysml.document`. Exactly one
|
|
486
|
+
of ``query_id`` and ``inline_query`` is given.
|
|
486
487
|
|
|
487
488
|
Args:
|
|
488
|
-
query_id (str): Qualified name of the document query
|
|
489
|
+
query_id (str, optional): Qualified name of the document query
|
|
489
490
|
bindings (Mapping, optional): Parameter name to a value or list of
|
|
490
491
|
values; an :class:`~opensysml.document.ElementRef` binds a
|
|
491
492
|
model element, an :class:`~opensysml.document.ObjectRef` an
|
|
492
493
|
object ``instantiate`` built, by id or by path
|
|
494
|
+
inline_query (str, optional): A query expression run in place of
|
|
495
|
+
a named query — ``Project(WhereType(Descendants(
|
|
496
|
+
Named("Vehicles")), "PartUsage"), ("name", "mass"))`` — with
|
|
497
|
+
the ``DocumentQueries`` library in scope; needs the
|
|
498
|
+
``inline_document_query`` capability
|
|
493
499
|
|
|
494
500
|
Returns:
|
|
495
501
|
DocumentQueryResult: Projected columns and typed rows, in the
|
|
@@ -509,9 +515,12 @@ class Model:
|
|
|
509
515
|
... bindings={"root": ElementRef("Observatory::telescope")})
|
|
510
516
|
>>> result.columns
|
|
511
517
|
('name', 'mass')
|
|
518
|
+
>>> model.run_document_query(
|
|
519
|
+
... inline_query='Project(Descendants(Observatory::telescope), ("name"))').columns
|
|
520
|
+
('name',)
|
|
512
521
|
"""
|
|
513
522
|
return self.connection.run_document_query(
|
|
514
|
-
self._hash, query_id, bindings=bindings,
|
|
523
|
+
self._hash, query_id, bindings=bindings, inline_query=inline_query,
|
|
515
524
|
)
|
|
516
525
|
|
|
517
526
|
def render_document(self, document_id, form="markdown"):
|