Skip to content

Conversation

@DrPaulSharp
Copy link
Contributor

No description provided.

Copy link
Contributor

@jamescrake-merani jamescrake-merani left a comment

Choose a reason for hiding this comment

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

I'm approving but take a quick look at the comments, and then merge if you're happy.

@@ -37,8 +34,6 @@
QC_ONLY = True # show only what is needed for dqc in the symmetric case

# include unicode symbols in output, even if piping to a pager
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this comment still needed now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think so, because the init_printing routine is there to allow printing unicode characters.

from docutils.writers.html4css1 import HTMLTranslator
from docutils.nodes import SkipNode

# pylint: disable=unused-import
Copy link
Contributor

Choose a reason for hiding this comment

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

I hesitated a bit when I saw that we previously disabled this unused import warning, but now I think about it, I think we already solved this problem by bumping the minimum Python version. So I don't think this is needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The import of Tuple is only used for a single type hint, and we're switching to using tuple instead of typing.Tuple throughout the code, so I'm happy that we're ok here.

@DrPaulSharp DrPaulSharp merged commit 4319826 into master Aug 8, 2025
20 checks passed
@DrPaulSharp DrPaulSharp deleted the pyupgrade branch August 8, 2025 11:03
def load_sasfit(path):
data = np.loadtxt(path, dtype=str, delimiter=';').T
data = np.vstack((map(float, v) for v in data[0:2]))
data = np.vstack(map(float, v) for v in data[0:2])
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be failing. For version 2.2.6 that I happen to have installed, np.vstack(generator) gives
TypeError: arrays to stack must be passed as a "sequence" type such as list or tuple.

This is a bug in the original, which should have used [...] rather than (...) when forming the sequence to send to vstack, so not an error introduced by this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for letting me know, I'll put in a one-liner PR to correct this.

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.

4 participants