Skip to content

draft: metadata support for columns#138

Draft
vincentkoppen wants to merge 10 commits intomainfrom
set-id-columns
Draft

draft: metadata support for columns#138
vincentkoppen wants to merge 10 commits intomainfrom
set-id-columns

Conversation

@vincentkoppen
Copy link
Member

For #136 we would like to have a programmable way to recognize id columns.

I tried by setting the type, however I did not really get anywhere with this. Instead I went with the metadata route in this setup.
It works, but not to sure whether I/we are comfortable with this implementation. Specifically since numpy has the following warning ;)

https://numpy.org/doc/stable/reference/generated/numpy.dtype.metadata.html

Although used in certain projects, this feature was long undocumented and is not well supported. Some aspects of metadata propagation are expected to change in the future.

How it works:

  • We add support to annotate a NDArray within a dtype definition with a dict (or we can choose a different datastructure)
  • We set the metadata provided in the dtype
  • We can now access the metadata where we want.

The main.py example code has the following output:

[('id', '<i4'), ('measured_object', '<i4'), ('u_sigma', '<f8', (3,)), ('u_measured', '<f8', (3,)), ('u_angle_measured', '<f8', (3,))] #the dtype
{'id': True} #metadata of "id" in dtype

mgovers and others added 10 commits January 12, 2026 10:42
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <martijn.govers@alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
…1-support

Signed-off-by: Thijs Baaijen <13253091+Thijss@users.noreply.github.com>

# Conflicts:
#	uv.lock
Signed-off-by: Thijs Baaijen <13253091+Thijss@users.noreply.github.com>
@vincentkoppen vincentkoppen added the do-not-merge This should not be merged label Jan 14, 2026
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
79.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Base automatically changed from feature/drop-python311-support to main January 16, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge This should not be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants