pydpm_xl 0.1.10__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.
Files changed (94) hide show
  1. py_dpm/AST/ASTConstructor.py +503 -0
  2. py_dpm/AST/ASTObjects.py +827 -0
  3. py_dpm/AST/ASTTemplate.py +101 -0
  4. py_dpm/AST/ASTVisitor.py +13 -0
  5. py_dpm/AST/MLGeneration.py +588 -0
  6. py_dpm/AST/ModuleAnalyzer.py +79 -0
  7. py_dpm/AST/ModuleDependencies.py +203 -0
  8. py_dpm/AST/WhereClauseChecker.py +12 -0
  9. py_dpm/AST/__init__.py +0 -0
  10. py_dpm/AST/check_operands.py +302 -0
  11. py_dpm/DataTypes/ScalarTypes.py +324 -0
  12. py_dpm/DataTypes/TimeClasses.py +370 -0
  13. py_dpm/DataTypes/TypePromotion.py +195 -0
  14. py_dpm/DataTypes/__init__.py +0 -0
  15. py_dpm/Exceptions/__init__.py +0 -0
  16. py_dpm/Exceptions/exceptions.py +84 -0
  17. py_dpm/Exceptions/messages.py +114 -0
  18. py_dpm/OperationScopes/OperationScopeService.py +247 -0
  19. py_dpm/OperationScopes/__init__.py +0 -0
  20. py_dpm/Operators/AggregateOperators.py +138 -0
  21. py_dpm/Operators/BooleanOperators.py +30 -0
  22. py_dpm/Operators/ClauseOperators.py +159 -0
  23. py_dpm/Operators/ComparisonOperators.py +69 -0
  24. py_dpm/Operators/ConditionalOperators.py +362 -0
  25. py_dpm/Operators/NumericOperators.py +101 -0
  26. py_dpm/Operators/Operator.py +388 -0
  27. py_dpm/Operators/StringOperators.py +27 -0
  28. py_dpm/Operators/TimeOperators.py +53 -0
  29. py_dpm/Operators/__init__.py +0 -0
  30. py_dpm/Utils/ValidationsGenerationUtils.py +429 -0
  31. py_dpm/Utils/__init__.py +0 -0
  32. py_dpm/Utils/operands_mapping.py +73 -0
  33. py_dpm/Utils/operator_mapping.py +89 -0
  34. py_dpm/Utils/tokens.py +172 -0
  35. py_dpm/Utils/utils.py +2 -0
  36. py_dpm/ValidationsGeneration/PropertiesConstraintsProcessor.py +190 -0
  37. py_dpm/ValidationsGeneration/Utils.py +364 -0
  38. py_dpm/ValidationsGeneration/VariantsProcessor.py +265 -0
  39. py_dpm/ValidationsGeneration/__init__.py +0 -0
  40. py_dpm/ValidationsGeneration/auxiliary_functions.py +98 -0
  41. py_dpm/__init__.py +61 -0
  42. py_dpm/api/__init__.py +140 -0
  43. py_dpm/api/ast_generator.py +438 -0
  44. py_dpm/api/complete_ast.py +241 -0
  45. py_dpm/api/data_dictionary_validation.py +577 -0
  46. py_dpm/api/migration.py +77 -0
  47. py_dpm/api/semantic.py +224 -0
  48. py_dpm/api/syntax.py +182 -0
  49. py_dpm/client.py +106 -0
  50. py_dpm/data_handlers.py +99 -0
  51. py_dpm/db_utils.py +117 -0
  52. py_dpm/grammar/__init__.py +0 -0
  53. py_dpm/grammar/dist/__init__.py +0 -0
  54. py_dpm/grammar/dist/dpm_xlLexer.interp +428 -0
  55. py_dpm/grammar/dist/dpm_xlLexer.py +804 -0
  56. py_dpm/grammar/dist/dpm_xlLexer.tokens +106 -0
  57. py_dpm/grammar/dist/dpm_xlParser.interp +249 -0
  58. py_dpm/grammar/dist/dpm_xlParser.py +5224 -0
  59. py_dpm/grammar/dist/dpm_xlParser.tokens +106 -0
  60. py_dpm/grammar/dist/dpm_xlParserListener.py +742 -0
  61. py_dpm/grammar/dist/dpm_xlParserVisitor.py +419 -0
  62. py_dpm/grammar/dist/listeners.py +10 -0
  63. py_dpm/grammar/dpm_xlLexer.g4 +435 -0
  64. py_dpm/grammar/dpm_xlParser.g4 +260 -0
  65. py_dpm/migration.py +282 -0
  66. py_dpm/models.py +2139 -0
  67. py_dpm/semantics/DAG/DAGAnalyzer.py +158 -0
  68. py_dpm/semantics/DAG/__init__.py +0 -0
  69. py_dpm/semantics/SemanticAnalyzer.py +320 -0
  70. py_dpm/semantics/Symbols.py +223 -0
  71. py_dpm/semantics/__init__.py +0 -0
  72. py_dpm/utils/__init__.py +0 -0
  73. py_dpm/utils/ast_serialization.py +481 -0
  74. py_dpm/views/data_types.sql +12 -0
  75. py_dpm/views/datapoints.sql +65 -0
  76. py_dpm/views/hierarchy_operand_reference.sql +11 -0
  77. py_dpm/views/hierarchy_preconditions.sql +13 -0
  78. py_dpm/views/hierarchy_variables.sql +26 -0
  79. py_dpm/views/hierarchy_variables_context.sql +14 -0
  80. py_dpm/views/key_components.sql +18 -0
  81. py_dpm/views/module_from_table.sql +11 -0
  82. py_dpm/views/open_keys.sql +13 -0
  83. py_dpm/views/operation_info.sql +27 -0
  84. py_dpm/views/operation_list.sql +18 -0
  85. py_dpm/views/operations_versions_from_module_version.sql +30 -0
  86. py_dpm/views/precondition_info.sql +17 -0
  87. py_dpm/views/report_type_operand_reference_info.sql +18 -0
  88. py_dpm/views/subcategory_info.sql +17 -0
  89. py_dpm/views/table_info.sql +19 -0
  90. pydpm_xl-0.1.10.dist-info/LICENSE +674 -0
  91. pydpm_xl-0.1.10.dist-info/METADATA +50 -0
  92. pydpm_xl-0.1.10.dist-info/RECORD +94 -0
  93. pydpm_xl-0.1.10.dist-info/WHEEL +4 -0
  94. pydpm_xl-0.1.10.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,27 @@
1
+ CREATE
2
+ OR ALTER
3
+ VIEW operation_info AS
4
+ select opN.NodeID as operation_node_id,
5
+ opN.OperationVID as operation_version_id,
6
+ opN.ParentNodeID as parent_node_id,
7
+ O.OperatorID as operator_id,
8
+ O.Symbol as symbol,
9
+ opA.Name as argument,
10
+ opA.[Order] as operator_argument_order,
11
+ opN.IsLeaf as is_leaf,
12
+ opN.Scalar as scalar,
13
+ opR.OperandReferenceId as operand_reference_id,
14
+ opR.OperandReference as operand_reference,
15
+ opR.ItemID as item_id,
16
+ opR.PropertyID as property_id,
17
+ opR.VariableID as variable_id,
18
+ opR.x,
19
+ opR.y,
20
+ opR.z,
21
+ opN.UseIntervalArithmetics as use_interval_arithmetics,
22
+ opN.FallbackValue as fallback_value
23
+ from [dbo].OperationNode opN
24
+ left join [dbo].OperandReference opR on opN.NodeID = opR.NodeID
25
+ left join [dbo].Operator O on O.OperatorID = opN.OperatorID
26
+ left join [dbo].OperatorArgument opA
27
+ on opN.ArgumentID = opA.ArgumentID;
@@ -0,0 +1,18 @@
1
+ CREATE OR ALTER VIEW operations AS
2
+ SELECT o.Code as operation_code,
3
+ ov.StartReleaseID as start_release,
4
+ ov.EndReleaseID as end_release,
5
+ ov.Expression as expression,
6
+ ov.OperationVID as operation_version_id,
7
+ ov.PreconditionOperationVID as precondition_operation_version_id
8
+ from Operation o
9
+ inner join OperationVersion ov on o.OperationId = ov.OperationId
10
+ where o.Code in (SELECT DISTINCT o.Code
11
+ from Operation o
12
+ inner join OperationVersion ov
13
+ on o.OperationID = ov.OperationID
14
+ left join dbo.OperationScope OS
15
+ on ov.OperationVID = OS.OperationVID
16
+ where OS.IsActive = 1)
17
+ -- inner join Expression E on ov.OperationVID = E.OperationVID
18
+ -- where E.LanguageID = 2;
@@ -0,0 +1,30 @@
1
+ CREATE OR ALTER VIEW operation_versions_from_module_version AS
2
+ SELECT MV.ModuleVID as module_version_id,
3
+ MV.ModuleID,
4
+ MV.StartReleaseID,
5
+ MV.EndReleaseID,
6
+ MV.Code as module_code,
7
+ MV.VersionNumber,
8
+ MV.FromReferenceDate as from_date,
9
+ MV.ToReferenceDate as to_date,
10
+ OSC.OperationScopeID as operation_scope_id,
11
+ OS.IsActive as is_active,
12
+ OS.Severity as severity,
13
+ OS.FromSubmissionDate,
14
+ ov.OperationVID as operation_version_id,
15
+ ov.OperationID,
16
+ ov.PreconditionOperationVID as precondition_operation_version_id,
17
+ ov.StartReleaseID as operation_start_release_id,
18
+ ov.EndReleaseID as operation_end_release_id,
19
+ ov.Expression as expression,
20
+ o.Code as operation_code,
21
+ o.[Type] as operation_type,
22
+ o.[Source] as operation_source
23
+ from ModuleVersion MV
24
+ inner join OperationScopeComposition OSC
25
+ on OSC.ModuleVID = MV.ModuleVID
26
+ inner join OperationScope OS
27
+ on OSC.OperationScopeID = OS.OperationScopeID
28
+ inner join OperationVersion ov on ov.OperationVID = OS.OperationVID
29
+ inner join Operation o on o.OperationID = ov.OperationID
30
+ where OS.IsActive = 1;
@@ -0,0 +1,17 @@
1
+ CREATE
2
+ OR ALTER
3
+ VIEW precondition_info AS
4
+ select opN.NodeID as operation_node_id,
5
+ opN.OperationVID as operation_version_id,
6
+ vv.VariableVID as variable_version_id,
7
+ vv.VariableID as variable_id,
8
+ vv.Code as variable_code,
9
+ v.Type as variable_type,
10
+ o.Code as operation_code
11
+ from [dbo].OperationNode opN
12
+ left join [dbo].OperandReference opR on opN.NodeID = opR.NodeID
13
+ inner join [dbo].OperationVersion ov on ov.OperationVID = opN.OperationVID
14
+ inner join [dbo].Operation o on o.OperationID = ov.OperationID
15
+ inner join [dbo].VariableVersion vv on vv.VariableVID = opR.VariableID
16
+ inner join [dbo].Variable v on v.VariableID = vv.VariableID
17
+ where v.Type = 'filingIndicator';
@@ -0,0 +1,18 @@
1
+ CREATE OR ALTER VIEW report_type_operand_reference_info AS
2
+ select distinct o.code as operation_code,
3
+ on2.NodeID as operation_node_id,
4
+ orl.CellID as cell_id,
5
+ or2.VariableID as variable_id,
6
+ o.[Source] as report_type,
7
+ tv.TableID as table_version_id,
8
+ tv.TableVID as table_version_vid,
9
+ or2.SubCategoryID as sub_category_id
10
+ FROM OperandReferenceLocation orl
11
+ inner join OperandReference or2
12
+ on orl.OperandReferenceID = or2.OperandReferenceID
13
+ inner join OperationNode on2 on on2.NodeID = or2.NodeID
14
+ inner join OperationVersion ov on ov.OperationVID = on2.OperationVID
15
+ inner join Operation o on o.OperationID = ov.OperationID
16
+ inner join Cell c on c.CellID = orl.CellID
17
+ inner join Tableversion tv on tv.TableID = c.TableID
18
+ where ov.EndReleaseID is NULL;
@@ -0,0 +1,17 @@
1
+ CREATE OR ALTER VIEW subcategory_item_info AS
2
+ SELECT ic.Code as item_code,
3
+ ic.IsDefaultItem as is_default_item,
4
+ scv.SubCategoryID as subcategory_id,
5
+ icp.Code as parent_item_code,
6
+ sci."Order" as ordering,
7
+ oa.Name as arithmetic_operator,
8
+ oc.Symbol as comparison_symbol,
9
+ scv.StartReleaseID as start_release_id,
10
+ scv.EndReleaseID as end_release_id
11
+ from SubCategoryItem sci
12
+ inner join SubCategoryVersion scv
13
+ on scv.SubCategoryVID = sci.SubCategoryVID
14
+ inner join ItemCategory ic on sci.ItemID = ic.ItemID
15
+ left join ItemCategory icp on sci.ParentItemID = icp.ItemID
16
+ left join Operator oa on sci.ArithmeticOperatorID = oa.OperatorID
17
+ left join Operator oc on sci.ComparisonOperatorID = oc.OperatorID
@@ -0,0 +1,19 @@
1
+ CREATE
2
+ OR ALTER
3
+ VIEW table_info AS
4
+ Select TV.Code as table_code,
5
+ TV.TableVID as table_version_id,
6
+ TV.TableID as table_id,
7
+ MV.ModuleVID as module_version_id,
8
+ MV.Code as module_code,
9
+ VV.VariableVID as variable_version_id,
10
+ VV.VariableID as variable_id
11
+ from Module M
12
+ inner join ModuleVersion MV
13
+ on M.ModuleID = MV.ModuleID and MV.EndReleaseID is NULL
14
+ inner join ModuleVersionComposition MVC on MV.ModuleVID = MVC.ModuleVID
15
+ inner join TableVersion TV
16
+ on MVC.TableVID = TV.TableVID and TV.EndReleaseID is NULL
17
+ inner join TableVersionCell TVC on TV.TableVID = TVC.TableVID
18
+ inner join VariableVersion VV on TVC.VariableVID = VV.VariableVID and
19
+ VV.EndReleaseID is NULL;