Skip to content

Commit 11feffd

Browse files
feat: change start id back to non breaking value
Signed-off-by: jaapschoutenalliander <[email protected]>
1 parent f415208 commit 11feffd

File tree

1 file changed

+2
-2
lines changed
  • src/power_grid_model_ds/_core/model/containers

1 file changed

+2
-2
lines changed

src/power_grid_model_ds/_core/model/containers/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def _get_empty_fields(cls) -> dict:
196196
empty_fields = {}
197197

198198
empty_fields.update(cls._get_empty_arrays())
199-
empty_fields.update({"_id_counter": -1})
199+
empty_fields.update({"_id_counter": 0})
200200
return empty_fields
201201

202202
@classmethod
@@ -212,7 +212,7 @@ def _update_id_counter(self, array, check_max_id: bool = True):
212212
array = self.attach_ids(array)
213213
elif np.any(array.id == EMPTY_ID):
214214
raise ValueError(f"Cannot append: array contains empty [{EMPTY_ID}] and non-empty ids.")
215-
elif check_max_id:
215+
elif check_max_id and self.id_counter > 0:
216216
# Only check for overlaps when array has prescribed (non-empty) IDs
217217
# Check if any incoming ID might overlap with existing IDs
218218
# This prevents overlaps since counter tracks the highest used ID

0 commit comments

Comments
 (0)