Comments (6)
I last change to Corr.m_eff
appears to have happened 5 months ago, what version did you use before and can you provide a minimal example for the error you are seeing?
from pyerrors.
I do not know, which version the script was previously running on. I think it was the first 2.0 release.
I have a correlator, which has values up to a certain timeslice and is then set to zero.
So you can see, where the problem occurs.
The error is:
m_eff=corr.m_eff(variant="cosh")
File "/usr/local/lib/python3.8/site-packages/pyerrors/correlators.py", line 631, in m_eff
newcontent.append(np.abs(find_root(self.content[t][0] / self.content[t + 1][0], root_function, guess=guess)))
File "/usr/local/lib/python3.8/site-packages/pyerrors/obs.py", line 744, in truediv
return derived_observable(lambda x, **kwargs: x[0] / x[1], [self, y], man_grad=[1 / y.value, - self.value / y.value ** 2])
ZeroDivisionError: float division by zero
from pyerrors.
Would you mind, if i change this?
from pyerrors.
Ah okay, I understand the problem, and there should be an easy fix, but I do not understand why it did not appear in earlier versions. I think we never explicitly checked whether the denominator is zero.
from pyerrors.
Feel free to fix this. A general way including other kind of arithmetic errors might be to check for an ArithmeticError
try:
newcontent.append(self.content[t] / self.content[t + 1])
except ArithmeticError:
newcontent.append(None)
from pyerrors.
Yes, you are right, we only checked for None not for zero. So maybe something that i did to the correlator with the previous version set it to None on these timeslices, but this behaviour changed. We might never know.
from pyerrors.
Related Issues (20)
- numerical differentiation in derived_obs not working HOT 5
- Automatic windowing method fails for gapped and irregular chains HOT 4
- Issues with _filter_zeroes and Corr HOT 4
- Exception when applying .symmetric() to Corr containing None HOT 1
- Gamma_method() is broken for Obs that are NaN
- Multi-dimensional fits
- Bug coming from difference in search methods in sfcf inputs HOT 2
- `Corr.show()` draws prange in same color as error bars. HOT 1
- No dobs-related functions from the input submodule can be used HOT 1
- GEVP eigenvectors with errors HOT 7
- Warning in pandas tests
- Numpy 1.25 breaks a few linalg functions HOT 3
- Failing python 3.12 pytest workflow
- Duplicate data cause `gamma_method()` to fail with an unhelpful message HOT 3
- plot_history unexpected behaviour for gapped idl HOT 2
- read_hd5 in pyerrors 2.9.0 not fully backwards compatible to <=2.8.2 HOT 1
- Read specific interval with read_ms5_xsf() HOT 2
- Files keyword for multiple reps in read_sfcf HOT 2
- pyerrors does not work with the upcoming numpy 2 release HOT 7
- Corr.__getitem__ unexpected behaviour HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyerrors.