Skip to content

Update numpy dependency version in pyproject.toml#54

Merged
AKuederle merged 13 commits intoEmbodiedCognition:masterfrom
davidpagnon:patch-1
Sep 8, 2025
Merged

Update numpy dependency version in pyproject.toml#54
AKuederle merged 13 commits intoEmbodiedCognition:masterfrom
davidpagnon:patch-1

Conversation

@davidpagnon
Copy link
Contributor

From the tests I ran (not extensive though), py-c3d works fine with numpy >= 2.0. Allowing it would help with dependency conflicts due to many newer libraries requiring later numpy versions.

From the tests I ran (not extensive though), py-c3d works fine with numpy >= 2.0. Allowing it would help with dependency conflicts due to many newer libraries requiring later numpy versions.
@davidpagnon
Copy link
Contributor Author

@AKuederle I could be wrong, I think you are the maintainer? It would be great to approve the workflow, and if all tests work fine, to push a new release :)

@AKuederle
Copy link
Collaborator

Looks like py3.7 runners don´t exist anymore... But I think it would be fair to drop support for all unsupported Python versions. So only support 3.9 and newer.

@AKuederle
Copy link
Collaborator

Looks like there are a couple of issues with the tests... Some of the official testfiles from the c3d website seem to have changed, causing some tests to fail. But there are also sime tests that seem to fail due to issues with more recent numpy versions.

Can you try running the test-suite locally and see if you can solve the numpy related issues?

@AKuederle
Copy link
Collaborator

One of the issues seems to be related to the same problem noted here:

#49 (comment)

@davidpagnon
Copy link
Contributor Author

Great, I was not expecting such a quick response!
I'll have a look tonight, and if I can't, by the end of the week.

@davidpagnon
Copy link
Contributor Author

Note: it seems like the previous fix (overflow error: int(words[0]) + int(words[1]) * 65536) led to a "mismatch in number of analog samples". I need to stop investigating for now, will check the rest later this week.

@davidpagnon
Copy link
Contributor Author

Okay, I think it's all good, tests run without any error!

I must say it was harder than I expected, and that I'm glad that LLMs are a thing now because Claude.ai helped me quite a bit...

c3d/c3d.py Outdated
Note that the index should be relative to 0 rather then the frame number provided by read_frames()!
'''
sh = np.array(frames, dtype=object).shape
# Determine shape without using np.array() which fails on inhomogeneous data
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only thing I am not 100% sure about. Why was this change required in the first place? So what changed either in numpy or the c3d format that np.array on frames failed? Do you know @davidpagnon ?

Rest of the changes look good :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, it worked but was overly complicated.
I now did something much simpler by transforming the array into dtype=object, which allows for calculating its shape without throwing an error.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! CI seems to pass as well now. I will merge it into master and then create a new release in the next couple of days. You can use the github master directly as dependency in the meantime for your project.

Let me know, if you encounter any issues that would block a release.

@davidpagnon
Copy link
Contributor Author

davidpagnon commented Sep 5, 2025

Hi again, any idea when you'll be able to release a new py-c3d version? :)
I did not encounter any issue on my end.

@AKuederle AKuederle merged commit 7051735 into EmbodiedCognition:master Sep 8, 2025
5 checks passed
@AKuederle
Copy link
Collaborator

Done :) Sorry for the delay

@davidpagnon
Copy link
Contributor Author

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants