Skip to content

CI,STYLE: narrow down ignore-words-list of codespell #38847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pandas/core/arrays/sparse/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,18 +333,18 @@ def to_coo(self):
if isinstance(dtype, SparseDtype):
dtype = dtype.subtype

cols, rows, datas = [], [], []
cols, rows, data = [], [], []
for col, name in enumerate(self._parent):
s = self._parent[name]
row = s.array.sp_index.to_int_index().indices
cols.append(np.repeat(col, len(row)))
rows.append(row)
datas.append(s.array.sp_values.astype(dtype, copy=False))
data.append(s.array.sp_values.astype(dtype, copy=False))

cols = np.concatenate(cols)
rows = np.concatenate(rows)
datas = np.concatenate(datas)
return coo_matrix((datas, (rows, cols)), shape=self._parent.shape)
data = np.concatenate(data)
return coo_matrix((data, (rows, cols)), shape=self._parent.shape)

@property
def density(self) -> float:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ filterwarnings =
junit_family=xunit2

[codespell]
ignore-words-list=ba,blocs,coo,datas,fo,hist,nd,ser
ignore-words-list=ba,blocs,coo,fo,hist,nd,ser
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to just ignore pandas/core/strings/accessor.py instead / in-addition to?

Copy link
Member

Choose a reason for hiding this comment

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

as in, ignore the whole file? Yes, that's easily done with

exclude: ^pandas/core/strings/accessor\.py$

in .pre-commit-config.yaml, it's just not clear to me why that would be preferrable

Copy link
Contributor

Choose a reason for hiding this comment

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

to avoid the fragility of 'fo'

Copy link
Member

Choose a reason for hiding this comment

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

@jreback an alternative would be to change the example to use 'nox' instead of 'fox' - which isn't a real animal, but at least then no is a real word and we avoid having to ignore an entire file, does that seem OK?

Copy link
Contributor

Choose a reason for hiding this comment

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

i would rather just ignore that example if we can. it IS pretty fragile. its not likely to change much in the future though, so i suppose if you can't ignore that line then just changing the example is prob ok.

Copy link
Member

Choose a reason for hiding this comment

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

OK if we use dog then there's no failures and we can use a real animal 🎉

The original PR changed the example actually, before I asked them to change (sorry @chinggg !) so I've added a commit for them - look good 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.

Yeah! Thanks @MarcoGorelli , it looks good to me.


[coverage:run]
branch = False
Expand Down