Open twVolc opened 3 years ago
@twVolc thanks for this, yeah seems like this is due to int/float and should be an easy fix. Will pick it up for the next release! If you have fixed it already (and perhaps the other issues you found) feel free to create a PR via a fork. Cheers
Hi @jgliss Thanks for the response and I really appreciate all of your work to provide this package! I haven't ever collaborated on github projects (but really should learn how to...), so I may make a mess of trying create a PR, but I can have a look into it and see what state my current pyplis module is in (I can't remember exactly what changes I have made to it).
Hey @twVolc thanks a lot for offering to contribute. If you create a PR from your fork, we can make it a draft and take it from there. With an open PR GitHub is really helpful there to revise changes from the diff.
Hi @jgliss I very stupidly made these changes on a conda install of pyplis locally, rather than on a forked version. I've just forked pyplis now and will try to get to grips with things so hopefully I can be a bit more helpful in the future! I'll try to integrate the fixes to the small bugs in this at some point and create a PR.
@twVolc no problem and thanks for helping! I am very happy for any contributions / feedback from your side. You can also create a draft PR and just push to that branch in your fork, whenever you have time and ping me in the PR if you want me to review any of your updates. Cheers, Jonas
Versions which may be useful for this issue:
I am getting an error when trying to use the DilutionCorr class with lines I am extracting manually from the on-/off-band images using click events on a matplotlib figure of the images. Having initiated the DilutionCorr object with two lines, I then call
det_topo_dists_line(line_id)
on the object. The end of the traceback is:Thinking that this may be an issue with the line coordinates
x0, x1
, I have tried casting my line coordinates toint
before generating the theLineOnImage
objects to pass toDilutionCorr
, but this didn't solve the problem. It seems that the issue is line 776 ingeometry.py
:l = sqrt(delx ** 2 + dely ** 2)
. This produces a float, which is throwing an error on the next line when usingl
inlinspace
. It might be that I am using these functions incorrectly, or I have set something up wrong to start with. I have found that castingl
to anint
solves the problem and the function runs to completion:l = int(np.round(sqrt(delx ** 2 + dely ** 2)))
I have tried to confirm this issue by running
ex11_signal_dilution.py
from pyplis example scripts and I do get the same error, which gives me some confidence that I haven't made a stupid mistake somewhere. Following my above edit the example script appears to run correctly. Perhaps this version of numpy has slightly different handling ofint/float
inlinspace
?