Skip to content

Commit

Permalink
add operators family layer
Browse files Browse the repository at this point in the history
  • Loading branch information
amattioc committed Apr 18, 2024
1 parent 9be94bc commit 8361a7b
Show file tree
Hide file tree
Showing 86 changed files with 49 additions and 35 deletions.
49 changes: 26 additions & 23 deletions v2.1/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,29 +36,32 @@ def name_norm(value):
for template in next(os.walk("templates"))[2]:
templates[template] = jinjaEnv.get_template(template)

# Apply templates in each op folder
for op_folder in next(os.walk("operators"))[1]:
# Write the op main page
op_path = Path("operators").joinpath(op_folder)
with open(op_path.joinpath("index.rst"), "w") as f:
f.write(templates["operator"].render({"title": op_folder}))
# Apply templates in each op type folder
for op_type in next(os.walk("operators"))[1]:
op_type_path = Path("operators").joinpath(op_type)
# Apply templates in each op folder
for op_folder in next(os.walk(op_type_path))[1]:
# Write the op main page
op_path = op_type_path.joinpath(op_folder)
with open(op_path.joinpath("index.rst"), "w") as f:
f.write(templates["operator"].render({"title": op_folder}))

# Write the op examples
examples_folder = op_path.joinpath("examples")
ds_list = sorted(x.with_suffix('').name for x in examples_folder.glob("ds_*.csv"))
inputs = []
for i in range(len(ds_list)):
inputs.append({ "folder": examples_folder, "i": i + 1, "name": ds_list[i] })
ex_list = sorted(x.with_suffix('').name for x in examples_folder.glob("ex_*.vtl"))
examples = []
for i in range(len(ex_list)):
examples.append({ "folder": examples_folder, "i": i + 1, "name": ex_list[i] })
with open(op_path.joinpath("examples.rst"), "w") as f:
f.write(
templates["examples"].render({"examples": examples, "inputs": inputs, "repourl_ex": "https://github.com/sdmx-twg/vtl/blob/master/v2.1/docs"})
)
# Write the op examples
examples_folder = op_path.joinpath("examples")
ds_list = sorted(x.with_suffix('').name for x in examples_folder.glob("ds_*.csv"))
inputs = []
for i in range(len(ds_list)):
inputs.append({ "folder": examples_folder, "i": i + 1, "name": ds_list[i] })
ex_list = sorted(x.with_suffix('').name for x in examples_folder.glob("ex_*.vtl"))
examples = []
for i in range(len(ex_list)):
examples.append({ "folder": examples_folder, "i": i + 1, "name": ex_list[i] })
with open(op_path.joinpath("examples.rst"), "w") as f:
f.write(
templates["examples"].render({"examples": examples, "inputs": inputs, "repourl_ex": "https://github.com/sdmx-twg/vtl/blob/master/v2.1/docs"})
)

plantuml = "java -jar " + os.getenv("PUML_PATH", "/tmp/plantuml-mit-1.2023.13.jar")
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,5 @@ Behavior
The operator has the behaviour of the "Operators applicable on one Scalar Value or Data Set or Data Set
Component" (see the section "Typical behaviours of the ML Operators").
According to the general rules about data types, the operator can be applied also on sub-types of number, that is
the type integer.
If the type of the operand is integer then the result has type integer. If the type of the operand is number then
the result has type number.
the type integer. If the type of the operand is integer then the result has type integer. If the type of the operand
is number then the result has type number.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Behavior

The operator has the behaviour of the "Operators applicable on one Scalar Value or Data Set or Data Set
Component" (see the section "Typical behaviours of the ML Operators").
According to the general rules about data types, the operator can be applied also on sub-types of number, that is
the type integer.
If the type of the operand is integer then the result has type integer. If the type of the operand is number then
the result has type number.
According to the general rules about data types, the operator can be applied also on sub-types of number,
that is the type integer. If the type of the operand is integer then the result has type integer. If the
type of the operand is number then the result has type number.
8 changes: 8 additions & 0 deletions v2.1/docs/operators/Numeric Operators/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
######################################
VTL-ML - Numeric Operators
######################################
.. toctree::
:glob:
:maxdepth: 1

*/index
8 changes: 8 additions & 0 deletions v2.1/docs/operators/String Operators/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
######################################
VTL-ML - String Operators
######################################
.. toctree::
:glob:
:maxdepth: 1

*/index
7 changes: 2 additions & 5 deletions v2.1/docs/operators/index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
###################
######################################
Reference Manual
###################

VTL-ML - Numeric operators (row 2907)
----------------------------------------
######################################
.. toctree::
:glob:
:maxdepth: 1
Expand Down

0 comments on commit 8361a7b

Please sign in to comment.