-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Atlas
do not infer correct values from np.array
#271
Comments
Atlas
do not infer correct values from np.arrays
Atlas
do not infer correct values from np.array
Line 63 in 0994336
eko/src/eko/quantities/heavy_quarks.py Line 65 in 0994336
eko/src/eko/quantities/heavy_quarks.py Line 22 in 0994336
So The error is coming from: Line 65 in 0994336
since I'm using list concatenation, but I specified that I want a list .
So, instead of using runtime checks, adding repeated code for it over and over, and consequently (an irrelevant) runtime overhead, I decided to rely on type-hints. |
I see, thanks for your precise reply. So far I see this was unspotted in pineko For my understanding why we can't use:
which should work both for |
We can, there is no problem. But the usage of NumPy arrays will be officially unsupported. So if it works, good for you, but if it will break, that will be simply the consequence of exploiting undefined behavior. There are two elements involved:
|
@giacomomagni For the specific case we're consistent Lines 454 to 456 in 0994336
I hope we're elsewhere as well ...
@alecandido I guess you want https://github.com/pre-commit/mirrors-mypy (see also #178 ) |
I was referring also to some cases like here, where I was not sure:
Let's hope so 😬 In any case since I understand this is a desired behaviour, feel free to close the issue. |
I can see the point of @alecandido , but I also agree partially with @andreab1997 : numpy is an integral part of EKO (we can not work without), but we don't like it in the input - this is not very obvious to an outsider ... for the case given by @giacomomagni above this can lead to
@andreab1997 was arguing along this line: you're not warned, not visibly |
Indeed. I would say that if also developers of |
Indeed I found this just looking by eyes at the runcards, |
At the moment, The idea is that, the moment it will be, the "warning" will be the docs. And actually is already there: The only problem is that EKO is documenting everything, so even the internals are documented at the same level of the public API. That is good for EKO developers, but we should split the public API from the rest (the hope was that introducing Then for sure we'd need a changelog. But hopefully we will need it less, because with the public API we will also try to enforce a certain stability.
For this, we are not using any solution for NumPy or any other external library (other than reading docs): if you use it wrongly, it can give wrong results (or crash, if you're lucky). However, the new adoption of type hints would unlock even that possibility, that is something more, not less. And you proposed yourself: we can add |
While trying to use the new eko
0.13.1
insidepineko
I found this weird behaviour,which I'm not sure we are aware of.
Do you know if this is might happen also for other classes such as
Couplings
?The text was updated successfully, but these errors were encountered: