pytrilogy 0.0.2.54__py3-none-any.whl → 0.0.2.55__py3-none-any.whl
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.
Potentially problematic release.
This version of pytrilogy might be problematic. Click here for more details.
- {pytrilogy-0.0.2.54.dist-info → pytrilogy-0.0.2.55.dist-info}/METADATA +1 -1
- {pytrilogy-0.0.2.54.dist-info → pytrilogy-0.0.2.55.dist-info}/RECORD +9 -9
- trilogy/__init__.py +1 -1
- trilogy/core/models.py +5 -1
- trilogy/parsing/render.py +21 -2
- {pytrilogy-0.0.2.54.dist-info → pytrilogy-0.0.2.55.dist-info}/LICENSE.md +0 -0
- {pytrilogy-0.0.2.54.dist-info → pytrilogy-0.0.2.55.dist-info}/WHEEL +0 -0
- {pytrilogy-0.0.2.54.dist-info → pytrilogy-0.0.2.55.dist-info}/entry_points.txt +0 -0
- {pytrilogy-0.0.2.54.dist-info → pytrilogy-0.0.2.55.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
trilogy/__init__.py,sha256=
|
|
1
|
+
trilogy/__init__.py,sha256=JnykGbcn-V3aG4x6q9pNpBv7a-8Pr93-61ey6CjNHBA,291
|
|
2
2
|
trilogy/compiler.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
trilogy/constants.py,sha256=qZ1d0hoKPPV2HHCoFwPYTVB7b6bXjpWvXd3lE-zEhy8,1494
|
|
4
4
|
trilogy/engine.py,sha256=yOPnR7XCjWG82Gym_LLZBkYKKJdLCvqdCyt8zguNcnM,1103
|
|
@@ -16,7 +16,7 @@ trilogy/core/exceptions.py,sha256=1c1lQCwSw4_5CQS3q7scOkXU8GQvullJXfPHubprl90,61
|
|
|
16
16
|
trilogy/core/functions.py,sha256=hDlwLxQUskT9iRcIic1lfACQnxMLNM5ASdHRPi0ghyw,10835
|
|
17
17
|
trilogy/core/graph_models.py,sha256=mameUTiuCajtihDw_2-W218xyJlvTusOWrEKP1yAWgk,2003
|
|
18
18
|
trilogy/core/internal.py,sha256=FQWbuETKPfzjALMmdXJwlOMlESfm2Z5gmErSsq3BX9c,1173
|
|
19
|
-
trilogy/core/models.py,sha256=
|
|
19
|
+
trilogy/core/models.py,sha256=J1s7EAbJIoHseoz1D1iP1sAbEDNt66cinS2VE-zLp7g,161242
|
|
20
20
|
trilogy/core/optimization.py,sha256=Jy3tVJNeqhpK6VSyTvgIWKCao6y-VCZ7mYA69MIF6L0,7989
|
|
21
21
|
trilogy/core/query_processor.py,sha256=V-TqybYO0kCY8O7Nk58OBhb7_eRPs_EqAwaQv-EYLSY,18615
|
|
22
22
|
trilogy/core/optimizations/__init__.py,sha256=EBanqTXEzf1ZEYjAneIWoIcxtMDite5-n2dQ5xcfUtg,356
|
|
@@ -75,13 +75,13 @@ trilogy/parsing/config.py,sha256=Z-DaefdKhPDmSXLgg5V4pebhSB0h590vI0_VtHnlukI,111
|
|
|
75
75
|
trilogy/parsing/exceptions.py,sha256=92E5i2frv5hj9wxObJZsZqj5T6bglvPzvdvco_vW1Zk,38
|
|
76
76
|
trilogy/parsing/helpers.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
77
77
|
trilogy/parsing/parse_engine.py,sha256=JGL2qm4L14ytkkB4FiwaXvC1EYJSOK9J0eemi6L94Bw,69222
|
|
78
|
-
trilogy/parsing/render.py,sha256=
|
|
78
|
+
trilogy/parsing/render.py,sha256=o4C12a407iZvlRGUJDiuJUezrLLo4QEaLtu60ZQX3gk,16942
|
|
79
79
|
trilogy/parsing/trilogy.lark,sha256=EazfEvYPuvkPkNjUnVzFi0uD9baavugbSI8CyfawShk,12573
|
|
80
80
|
trilogy/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
81
81
|
trilogy/scripts/trilogy.py,sha256=DQDW81E5mDMWFP8oPw8q-IyrR2JGxQSDWgUWe2VTSRQ,3731
|
|
82
|
-
pytrilogy-0.0.2.
|
|
83
|
-
pytrilogy-0.0.2.
|
|
84
|
-
pytrilogy-0.0.2.
|
|
85
|
-
pytrilogy-0.0.2.
|
|
86
|
-
pytrilogy-0.0.2.
|
|
87
|
-
pytrilogy-0.0.2.
|
|
82
|
+
pytrilogy-0.0.2.55.dist-info/LICENSE.md,sha256=5ZRvtTyCCFwz1THxDTjAu3Lidds9WjPvvzgVwPSYNDo,1042
|
|
83
|
+
pytrilogy-0.0.2.55.dist-info/METADATA,sha256=FFvNA0mm8yeWHphFZm0-LAIoPu_qbPSSYwTzoXVz1yI,8823
|
|
84
|
+
pytrilogy-0.0.2.55.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
85
|
+
pytrilogy-0.0.2.55.dist-info/entry_points.txt,sha256=0petKryjvvtEfTlbZC1AuMFumH_WQ9v8A19LvoS6G6c,54
|
|
86
|
+
pytrilogy-0.0.2.55.dist-info/top_level.txt,sha256=cAy__NW_eMAa_yT9UnUNlZLFfxcg6eimUAZ184cdNiE,8
|
|
87
|
+
pytrilogy-0.0.2.55.dist-info/RECORD,,
|
trilogy/__init__.py
CHANGED
trilogy/core/models.py
CHANGED
|
@@ -852,7 +852,7 @@ class Concept(Mergeable, Namespaced, SelectContext, BaseModel):
|
|
|
852
852
|
|
|
853
853
|
class ConceptRef(BaseModel):
|
|
854
854
|
address: str
|
|
855
|
-
line_no: int
|
|
855
|
+
line_no: int | None = None
|
|
856
856
|
|
|
857
857
|
def hydrate(self, environment: Environment) -> Concept:
|
|
858
858
|
return environment.concepts.__getitem__(self.address, self.line_no)
|
|
@@ -3319,6 +3319,10 @@ class Environment(BaseModel):
|
|
|
3319
3319
|
read = f.read()
|
|
3320
3320
|
return Environment(working_path=Path(path).parent).parse(read)[0]
|
|
3321
3321
|
|
|
3322
|
+
@classmethod
|
|
3323
|
+
def from_string(cls, input: str) -> "Environment":
|
|
3324
|
+
return Environment().parse(input)[0]
|
|
3325
|
+
|
|
3322
3326
|
@classmethod
|
|
3323
3327
|
def from_cache(cls, path) -> Optional["Environment"]:
|
|
3324
3328
|
with open(path, "r") as f:
|
trilogy/parsing/render.py
CHANGED
|
@@ -18,6 +18,7 @@ from trilogy.core.models import (
|
|
|
18
18
|
Concept,
|
|
19
19
|
ConceptDeclarationStatement,
|
|
20
20
|
ConceptDerivation,
|
|
21
|
+
ConceptRef,
|
|
21
22
|
ConceptTransform,
|
|
22
23
|
Conditional,
|
|
23
24
|
CopyStatement,
|
|
@@ -256,8 +257,18 @@ class Renderer:
|
|
|
256
257
|
namespace = ""
|
|
257
258
|
if not concept.lineage:
|
|
258
259
|
if concept.purpose == Purpose.PROPERTY and concept.keys:
|
|
259
|
-
|
|
260
|
-
|
|
260
|
+
if len(concept.keys) == 1:
|
|
261
|
+
output = f"{concept.purpose.value} {self.to_string(ConceptRef(address=list(concept.keys)[0]))}.{namespace}{concept.name} {self.to_string(concept.datatype)};"
|
|
262
|
+
else:
|
|
263
|
+
keys = ",".join(
|
|
264
|
+
sorted(
|
|
265
|
+
list(
|
|
266
|
+
self.to_string(ConceptRef(address=x))
|
|
267
|
+
for x in concept.keys
|
|
268
|
+
)
|
|
269
|
+
)
|
|
270
|
+
)
|
|
271
|
+
output = f"{concept.purpose.value} <{keys}>.{namespace}{concept.name} {self.to_string(concept.datatype)};"
|
|
261
272
|
else:
|
|
262
273
|
output = f"{concept.purpose.value} {namespace}{concept.name} {self.to_string(concept.datatype)};"
|
|
263
274
|
else:
|
|
@@ -377,8 +388,16 @@ class Renderer:
|
|
|
377
388
|
|
|
378
389
|
@to_string.register
|
|
379
390
|
def _(self, arg: "FilterItem"):
|
|
391
|
+
|
|
380
392
|
return f"filter {self.to_string(arg.content)} where {self.to_string(arg.where)}"
|
|
381
393
|
|
|
394
|
+
@to_string.register
|
|
395
|
+
def _(self, arg: "ConceptRef"):
|
|
396
|
+
ns, base = arg.address.rsplit(".", 1)
|
|
397
|
+
if ns == DEFAULT_NAMESPACE:
|
|
398
|
+
return base
|
|
399
|
+
return arg.address
|
|
400
|
+
|
|
382
401
|
@to_string.register
|
|
383
402
|
def _(self, arg: "ImportStatement"):
|
|
384
403
|
path: str = str(arg.path).replace("\\", ".")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|