Skip to content

Conversation

@DimitriPapadopoulos
Copy link
Contributor

@DimitriPapadopoulos DimitriPapadopoulos commented Sep 21, 2021

Fix typos found by codespell.

  • Typos from upstream sources have not been fixed.
  • The changelog and typos from commit messages have not been fixed.
  • Typos in actual code have been fixed when harmless.
  • Typos in NEPs have not been fixed.

Copy link
Contributor

@bashtage bashtage left a comment

Choose a reason for hiding this comment

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

One definite wrong fix, one small quibble about whether keyserver is a technical word/

for (; count > 0; count -= vstep, data0 += vstep, data1 += vstep) {
npyv_@sfx@ a = npyv_load_tillz_@sfx@(data0, count);
npyv_@sfx@ b = npyv_load_tillz_@sfx@(data1, count);
vaccum = npyv_muladd_@sfx@(a, b, vaccum);
Copy link
Contributor

Choose a reason for hiding this comment

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

This fix is wrong. The work is not vacuum. It is essentially v_accum.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, sorry, I thought it was some sort of joke because of the initialization to 0's, or something like that. Will revert it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to v_accum.

const int is_aligned = EINSUM_IS_ALIGNED(data);
const int vstep = npyv_nlanes_@sfx@;
npyv_@sfx@ vaccum = npyv_zero_@sfx@();
npyv_@sfx@ vacuum = npyv_zero_@sfx@();
Copy link
Contributor

Choose a reason for hiding this comment

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

Please restore all vaccum to vaccum, or possibly change to v_accum.

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, perhaps v_accum would be better.

Copy link
Member

@melissawm melissawm left a comment

Choose a reason for hiding this comment

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

Looks mostly ok to me, I'm just not sure about the variable names.

{
/* Allow calling the function multiple times. */
static npy_bool initalized = NPY_FALSE;
static npy_bool initialized = NPY_FALSE;
Copy link
Member

Choose a reason for hiding this comment

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

I'm always weary of correcting variable names even if there is a typo, just my 2 cents here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do understand that. On the other hand, code is for humans, typos don't help, and tests are supposed to catch errors. I really don't know.

Copy link
Contributor Author

@DimitriPapadopoulos DimitriPapadopoulos Sep 21, 2021

Choose a reason for hiding this comment

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

It's just a local variable of the very small get_sfloat_dtype() function, it cannot even shadow other variables. Also, this is C code, and it compiles without a problem.

I feel this modification is very safe.

Comment on lines 471 to 472
# `delimitor` is misspelled
mrectxt = fromtextfile(path, delimitor=',', varnames='ABCDEFG')
Copy link
Member

Choose a reason for hiding this comment

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

Should we open an issue to fix this? Not sure if this gets exposed to the users at all.

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 was planning another PR for that, if needed.

Copy link
Contributor Author

@DimitriPapadopoulos DimitriPapadopoulos Sep 21, 2021

Choose a reason for hiding this comment

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

Indeed, the numpy.ma.mrecords submodule is not exported, only numpy.ma.core and numpy.ma.extras are:
https://github.com/numpy/numpy/blob/c2ad604/numpy/ma/__init__.py#L48

Also missing from the Masked Arrays documentation.

That will be easy to fix here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure what you mean by "not exported". numpy.ma.mrecords is "public API" I think (although I suspect an extremely unused part of it).

Copy link
Member

@seberg seberg Sep 21, 2021

Choose a reason for hiding this comment

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

Ooopst :/! I missed that this ended up being changed. Could you make a PR to revert this?

EDIT: I am not 100% sure if we cannot get away with changing it, but we can discuss on the reverse 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.

It's not in numpy.ma.__all__:
https://github.com/numpy/numpy/blob/c2ad604/numpy/ma/__init__.py#L48
It's not in the documentation, either.

This doesn't mean it's not part of the public API, though.

I can submit another PR, where I would restore the delimitor parameter, undocumented, alongside the new delimiter parameter. When both are defined, I would give delimiter priority - or maybe delimitor for total backwards compatibility?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See #19921.

@charris
Copy link
Member

charris commented Sep 21, 2021

For the future reference, fixing typos in NEPs is OK IMHO.

@melissawm melissawm self-requested a review September 21, 2021 22:38
@seberg
Copy link
Member

seberg commented Sep 21, 2021

Thanks @DimitriPapadopoulos and everyone going through the changes! LGTM, and I am happy to change those variable typos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants