Skip to content
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

Rm/packaging dependency #770

Merged
merged 5 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# HDMF Changelog

## HDMF 3.4.4 (September 20, 2022)

### Bug fixes
- Fixed missing dependency "packaging" introduced in 3.4.3. The code has been updated to avoid the dependency. @rly @oruebel ([#770](https://github.com/hdmf-dev/hdmf/pull/770))

## HDMF 3.4.3 (September 14, 2022)

### Minor improvements
Expand Down
13 changes: 2 additions & 11 deletions src/hdmf/common/alignedtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import numpy as np
import pandas as pd
from packaging import version

from . import register_class
from .table import DynamicTable
Expand Down Expand Up @@ -248,11 +247,7 @@ def to_dataframe(self, **kwargs):
dfs += [category.to_dataframe().reset_index() for category in self.category_tables.values()]
names = [self.name, ] + list(self.category_tables.keys())
res = pd.concat(dfs, axis=1, keys=names)
# TODO: Once Pandas minimum version has increased to 1.5 drop the if/else and just use the 1.5 approach
if version.parse(pd.__version__) >= version.parse("1.5.0"):
res = res.set_index((self.name, 'id'), drop=True, copy=False) # pragma: no cover
else:
res.set_index((self.name, 'id'), drop=True, inplace=True)
res.set_index((self.name, 'id'), drop=True, inplace=True)
return res

def __getitem__(self, item):
Expand Down Expand Up @@ -316,11 +311,7 @@ def get(self, item, **kwargs):
[category[item].reset_index() for category in self.category_tables.values()])
names = [self.name, ] + list(self.category_tables.keys())
res = pd.concat(dfs, axis=1, keys=names)
# TODO: Once Pandas minimum version has increased to 1.5 drop the if/else and just use the 1.5 approach
if version.parse(pd.__version__) >= version.parse("1.5.0"):
res = res.set_index((self.name, 'id'), drop=True, copy=False) # pragma: no cover
else:
res.set_index((self.name, 'id'), drop=True, inplace=True)
res.set_index((self.name, 'id'), drop=True, inplace=True)
return res
elif isinstance(item, str) or item is None:
if item in self.colnames:
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ commands = {[testenv:build]commands}
# Envs that will test installation from a wheel
[testenv:wheelinstall]
deps = null
commands = python -c "import hdmf"
commands = python -c "import hdmf; import hdmf.common"

# Envs that will execute gallery tests
[testenv:gallery]
Expand Down