Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Commit 1228661, 'Rule E712: true-false-comparison', replaced boolean comparison
==
with boolean comparison by idis
in some conditional statements which results in exceptions not raised and unexpected behavior.The commit attached replaces comparison by id
fn() is False
with truthy true/falsenot fn()
for conditional logic that compares the result of a callable to a boolean. It restores the original behavior (<=v0.26.0) of the modified functions.Cascading two networks with different frequency data is shown below to demonstrate the issue.
(<=v0.26.0, attached):
The original code / attached changes return a network with the intersecting subset of frequency data.
skrf.connect
raises anIndexError
by way ofskrf.check_frequency_equal
if the frequency data is not equal and no common values are found withnp.intersect1d
. If some common values are found, a warning alerts about dropped data.(v0.27.1, v0.28.0):
In the current release
skrf.connect
always returns frequency data from the first input as a result of the conditionalskrf.assert_frequency_equal is False
never being satisfied in the functionskrf.check_frequency_equal
and not raising theIndexError
which is caught inskrf.connect
to determine the shared subset of values.