FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixed warning for complex perm by JacobTh98 · Pull Request #110 · eitcom/pyEIT · GitHub

/ pyEIT Public

Fixed warning for complex perm - #110

Merged
liubenyuan merged 5 commits into
eitcom:masterfrom
JacobTh98:master
Dec 12, 2025
Merged

Fixed warning for complex perm #110
liubenyuan merged 5 commits into
eitcom:masterfrom
JacobTh98:master

Conversation

Copy link
Copy Markdown
Contributor

If a complex perm value like perm = 100 + 10j was assigned to an anomaly, the resulting simulated voltages of the forward EIT model were real valued. This is also because of the initialized array in fem.py line 120:

result = np.empty((ex_mat.shape[0], self.kg.shape[0]))

This PR simply changes the data type of the NumPy array to complex.
Finally, the output values for the simulated forward EIT model will be complex.
The following warning will no longer appear:

For the reconstruction algorithms still the following warning will still appear:
ComplexWarning: Casting complex values to real discards the imaginary part
jac[:, e] = np.sum(np.dot(ri[:, ijk], self.se[e]) * f_n[:, ijk], axis=1)

liubenyuan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Could you please also fix the linting error on line 603 of quality/merit.py by replacing np.NaN with np.nan?

Copy link
Copy Markdown
Contributor Author

After replacing np.NaN with np.nan one after the other, the linting process runs through.

liubenyuan merged commit 106863a into eitcom:master Dec 12, 2025
5 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL