Skip to content

Commit

Permalink
Rm/packaging dependency (#770)
Browse files Browse the repository at this point in the history
  • Loading branch information
oruebel authored Sep 19, 2022
1 parent 2010de6 commit 707e467
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
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

0 comments on commit 707e467

Please sign in to comment.