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

Last time index fixes #70

Merged
merged 10 commits into from
Jan 18, 2018
Merged

Last time index fixes #70

merged 10 commits into from
Jan 18, 2018

Conversation

rwedge
Copy link
Contributor

@rwedge rwedge commented Jan 17, 2018

Bugfixes addressing several issues when calculating last_time_index:

  • Ignoring last_time_index instance values taken from one child entity if that parent instance was not present in another child entity
  • Not always choosing the most recent time for an instance's last_time_index if the entity had multiple generations of child entities

@codecov-io
Copy link

codecov-io commented Jan 18, 2018

Codecov Report

Merging #70 into master will increase coverage by 0.24%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #70      +/-   ##
=========================================
+ Coverage   87.36%   87.6%   +0.24%     
=========================================
  Files          74      75       +1     
  Lines        6986    7131     +145     
=========================================
+ Hits         6103    6247     +144     
- Misses        883     884       +1
Impacted Files Coverage Δ
entityset/entityset.py 89.91% <0%> (-0.11%) ⬇️
tests/entityset_tests/test_pandas_es.py 99.72% <0%> (-0.02%) ⬇️
computational_backends/pandas_backend.py 87.19% <0%> (ø) ⬆️
tests/entityset_tests/test_last_time_index.py 100% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53cc701...01240c5. Read the comment docs.

if entity.has_time_index():
entity.set_last_time_index(entity.df[entity.time_index])
else:
lti = copy.deepcopy(entity.df[entity.time_index])
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason you can't just use entity.df[entity.time_index].copy()?

else:
lti = copy.deepcopy(entity.df[entity.index])
lti[:] = None
lti = pd.to_datetime(lti)
Copy link
Contributor

@kmax12 kmax12 Jan 18, 2018

Choose a reason for hiding this comment

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

did we require lti to be a datetime before? why do we need to convert it here?

@kmax12
Copy link
Contributor

kmax12 commented Jan 18, 2018

Looks good to me! BTW, great job writing tests for this.

@kmax12 kmax12 merged commit cc90537 into master Jan 18, 2018
@rwedge rwedge mentioned this pull request Jan 18, 2018
@kmax12 kmax12 deleted the last-time-index-fixes branch January 18, 2018 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants