pydpm_xl 0.2.10__py3-none-any.whl → 0.2.11__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.
py_dpm/__init__.py CHANGED
@@ -41,7 +41,7 @@ Available packages:
41
41
  - pydpm.api: Main APIs for migration, syntax, and semantic analysis
42
42
  """
43
43
 
44
- __version__ = "0.2.10"
44
+ __version__ = "0.2.11"
45
45
  __author__ = "MeaningfulData S.L."
46
46
  __email__ = "info@meaningfuldata.eu"
47
47
  __license__ = "GPL-3.0-or-later"
@@ -2206,12 +2206,11 @@ class ASTGeneratorAPI:
2206
2206
  entry["x"] = x_index
2207
2207
 
2208
2208
  # Calculate y coordinate (column position)
2209
+ # Only add y if there are multiple columns
2209
2210
  if cols and col_code in cols:
2210
2211
  y_index = cols.index(col_code) + 1
2211
- entry["y"] = y_index
2212
- elif not cols:
2213
- # Default to 1 if no column info
2214
- entry["y"] = 1
2212
+ if len(cols) > 1:
2213
+ entry["y"] = y_index
2215
2214
 
2216
2215
  # Calculate z coordinate (sheet position)
2217
2216
  if sheets and sheet_code in sheets:
@@ -2238,13 +2237,16 @@ class ASTGeneratorAPI:
2238
2237
  Remove extra fields from data entries in the AST.
2239
2238
 
2240
2239
  Keeps only the fields required by the engine:
2241
- - datapoint, operand_reference_id, y, column, x (if multiple rows), z (if multiple sheets)
2240
+ - datapoint, operand_reference_id (always)
2241
+ - x and row (only if multiple rows - rows are variable)
2242
+ - y and column (only if multiple columns - columns are variable)
2243
+ - z and sheet (only if multiple sheets - sheets are variable)
2242
2244
 
2243
2245
  Removes internal/debug fields:
2244
- - data_type, cell_code, table_code, table_vid, row
2246
+ - data_type, cell_code, table_code, table_vid
2245
2247
  """
2246
- # Fields to keep in data entries
2247
- ALLOWED_FIELDS = {"datapoint", "operand_reference_id", "x", "y", "z", "column", "sheet"}
2248
+ # Base fields to always keep in data entries
2249
+ BASE_FIELDS = {"datapoint", "operand_reference_id"}
2248
2250
 
2249
2251
  def clean_node(node):
2250
2252
  if isinstance(node, dict):
@@ -2252,9 +2254,22 @@ class ASTGeneratorAPI:
2252
2254
  if node.get("class_name") == "VarID" and "data" in node:
2253
2255
  cleaned_data = []
2254
2256
  for data_entry in node["data"]:
2257
+ # Build allowed fields based on which coordinates are present
2258
+ # Only keep row/column/sheet if the corresponding x/y/z coordinate exists
2259
+ allowed = set(BASE_FIELDS)
2260
+ if "x" in data_entry:
2261
+ allowed.add("x")
2262
+ allowed.add("row")
2263
+ if "y" in data_entry:
2264
+ allowed.add("y")
2265
+ allowed.add("column")
2266
+ if "z" in data_entry:
2267
+ allowed.add("z")
2268
+ allowed.add("sheet")
2269
+
2255
2270
  # Keep only allowed fields
2256
2271
  cleaned_entry = {
2257
- k: v for k, v in data_entry.items() if k in ALLOWED_FIELDS
2272
+ k: v for k, v in data_entry.items() if k in allowed
2258
2273
  }
2259
2274
  cleaned_data.append(cleaned_entry)
2260
2275
  node["data"] = cleaned_data
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydpm_xl
3
- Version: 0.2.10
3
+ Version: 0.2.11
4
4
  Summary: Python library for DPM-XL data processing and analysis
5
5
  Author-email: "MeaningfulData S.L." <info@meaningfuldata.eu>
6
6
  License: GPL-3.0-or-later
@@ -1,4 +1,4 @@
1
- py_dpm/__init__.py,sha256=8RZiE-F0XPTFPGEyFhEp9cS-0ahXQN5PMGSlLRrarL8,1859
1
+ py_dpm/__init__.py,sha256=mCQT4E9AM2a8Gg_V4tbxaQkfJ_CB9uUJR0fH7DR9uVI,1859
2
2
  py_dpm/api/__init__.py,sha256=bPWo4KWW99GmGkQbq0yQ3_tbTxvidEVVrWmcDXWz-xA,828
3
3
  py_dpm/api/dpm/__init__.py,sha256=HQflgiRbs1eDi3KTadNhxS1NoaG6PGQDVMvFnuIEfXo,506
4
4
  py_dpm/api/dpm/data_dictionary.py,sha256=q6w_5bFdc6WPd5Z601PpDaCcnIw39CnI4wdby3GJmFU,29893
@@ -7,7 +7,7 @@ py_dpm/api/dpm/hierarchical_queries.py,sha256=X4AbpsWy3iItOTVIdVbtaTmRgOHPf0Y64I
7
7
  py_dpm/api/dpm/instance.py,sha256=v3DWzdaM5gPCecLjwjZ49FGfqZzUR3dPC0U8zGwdttk,3795
8
8
  py_dpm/api/dpm/migration.py,sha256=9FT7zzz4QdUIRR6MD01gMODBtfq9HH_RF4hRgZqMcZc,2404
9
9
  py_dpm/api/dpm_xl/__init__.py,sha256=SOsCtwxuCkFQIdYoTcU6tVJdK1j96dPF4ZQpr8okLPc,576
10
- py_dpm/api/dpm_xl/ast_generator.py,sha256=hmfy2qV5t_RFGgmid7YuCXbrkjknv1KuQaJGxbXuHLs,97583
10
+ py_dpm/api/dpm_xl/ast_generator.py,sha256=53Hq1I2Uey6VqNmehU-6vSjyUnfU56GhcJKZuNZAEFw,98334
11
11
  py_dpm/api/dpm_xl/complete_ast.py,sha256=jjn9tsns4X7EN4RV5mFh5DRxxZfBOuX2b1wic4oB_ls,3967
12
12
  py_dpm/api/dpm_xl/operation_scopes.py,sha256=v2t3f2-AiF39hspNtpf_PA94T69JqbymFK9a5hpckRs,48831
13
13
  py_dpm/api/dpm_xl/semantic.py,sha256=Ddmh2Wj_iXIpQZ4jCjqOI-6ddFCquaO9RTu6W9i1Rts,13968
@@ -76,9 +76,9 @@ py_dpm/exceptions/exceptions.py,sha256=6S3p-_i5O1oStvSMixt_JQG0xwTeSfBcdzrwL8yBy
76
76
  py_dpm/exceptions/messages.py,sha256=UwY6QIK8c-POcDCc9HYbZFGArCIYAanUGNh2LNKPx3U,7534
77
77
  py_dpm/instance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
78
78
  py_dpm/instance/instance.py,sha256=gRSg2dh1nEa0Srx9yKcN3bxiYidvZyRU_jsTNaKkP5I,10882
79
- pydpm_xl-0.2.10.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
80
- pydpm_xl-0.2.10.dist-info/METADATA,sha256=SPIgOJT90xDaqE4CYrE2VIsWXOAzGmXbLlI8Yl7yv9I,9154
81
- pydpm_xl-0.2.10.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
82
- pydpm_xl-0.2.10.dist-info/entry_points.txt,sha256=6DDmBfw-AjtgvMHgq_I730i_LAAs_7-N3C95HD_bRr4,47
83
- pydpm_xl-0.2.10.dist-info/top_level.txt,sha256=495PvWZRoKl2NvbQU25W7dqWIBHqY-mFMPt83uxPpcM,7
84
- pydpm_xl-0.2.10.dist-info/RECORD,,
79
+ pydpm_xl-0.2.11.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
80
+ pydpm_xl-0.2.11.dist-info/METADATA,sha256=JXXtaUl9tMD7TSrGR5G9KWu_d1gTwutLIVpWYBJY18g,9154
81
+ pydpm_xl-0.2.11.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
82
+ pydpm_xl-0.2.11.dist-info/entry_points.txt,sha256=6DDmBfw-AjtgvMHgq_I730i_LAAs_7-N3C95HD_bRr4,47
83
+ pydpm_xl-0.2.11.dist-info/top_level.txt,sha256=495PvWZRoKl2NvbQU25W7dqWIBHqY-mFMPt83uxPpcM,7
84
+ pydpm_xl-0.2.11.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.10.1)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5