eitcom / pyEIT

Python based toolkit for Electrical Impedance Tomography
Other
169 stars 96 forks source link

Problem #56

Closed xlzhang517 closed 2 years ago

xlzhang517 commented 2 years ago

Hi, totay, i install pyeit by "conda install -c conda-forge pyeit", but when i run "python eit_dynamic_bp.py" for test, i have some problem as follow, i dont know why where is wrong, hope your answer. Traceback (most recent call last): File "E:\pyEIT\examples\fem_forward2d.py", line 38, in protocol_obj = protocol.create(n_el, dist_exc=7, step_meas=1, parser_meas="std") File "E:\pyEIT2\lib\site-packages\pyeit\eit\protocol.py", line 188, in create return PyEITProtocol(ex_mat, meas_mat) TypeError: init() takes 1 positional argument but 3 were given

BR, xlzhang.

liubenyuan commented 2 years ago

I test it under windows 11, python 3.10.4, and run both eit_dynamic_bp.py and fem_forward2d.py, and it reports no error. Could you please share the PYTHONPATH settings and python, numpy versions?

It seems that you are running fem_forward2d.py, you may debug into line 188 of protocol.py and see what happens there.

xlzhang517 commented 2 years ago

Just now, i replace the whole file "protocol.py" contents using "protocol.py" of the source code, and it works. THANKS VERY MUCH!

liubenyuan commented 2 years ago

Haha, so could you do a diff and upload the differences?

xlzhang517 commented 2 years ago

The difference between two file is the position of "ex_mat: np.ndarray meas_mat: np.ndarray" in class PyEITProtocol . Version has problem:

"""
EIT Protocol buid-in protocol object
ex_mat: np.ndarray
meas_mat: np.ndarray
"""

however, right version is

"""
EIT Protocol buid-in protocol object
"""
ex_mat: np.ndarray
meas_mat: np.ndarray

"ex_mat: np.ndarray meas_mat: np.ndarray" must be outside of explanation

liubenyuan commented 2 years ago

It seems like the wrong conda-forge version comment out these variable. Is the conda version you installed is pyeit-1.2.2?

liubenyuan commented 2 years ago

I checked recent version of pyeit on conda-forge, pyeit, they are ok with the right PyEITProtocol parameters. So this might be that some codes have been accidentally commented out.