datactive / bigbang

Scientific analysis of collaborative communities
http://datactive.github.io/bigbang/
MIT License
154 stars 51 forks source link

Fix git_repo.py bug #406

Closed Christovis closed 3 years ago

Christovis commented 3 years ago

Running the tests from a freshly cloned repo result in an error in TestGit at line 24: repo = repo_loader.get_repo("https://github.com/sbenthall/bigbang.git", in_type = "remote") The error is cause by: time_index = pd.DatetimeIndex(raw["Time"], periods = 24) The error message is: TypeError: __new__() got an unexpected keyword argument 'periods'

My setup in short is the following: platform linux -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 pandas-1.2.1

I fixed it by changing the line 122f in git_repo.py to:

time_index = pd.DatetimeIndex(raw["Time"]).to_period("H")
time_index = utils.add_freq(time_index, freq=None)

Note: as my editor automatically removes unnecessary white spaces, more lines were changed besides the two that are crucial.

sbenthall commented 3 years ago

Thanks for this. Merging