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

Exports flattened output for erfs_fpr #177

Merged
merged 8 commits into from
Oct 24, 2019
Merged

Conversation

sandcha
Copy link
Contributor

@sandcha sandcha commented Oct 21, 2019

New features

  • Introduce export_flattened_df argument in create_input_data_frame function
    • Allows for one dummy_data.h5 file export that contains only one flattened table (one line per individual) instead of exporting an h5 file with several tables (one with individual and one for households). This fits better certain ways of importing back the data into openfisca (e.g. LexImpact).
  • Upgrade numexpr top version to the version used by Core.

@sandcha
Copy link
Contributor Author

sandcha commented Oct 21, 2019

@benjello Instead of merging this PR into release/1.0.0 branch, what do you think of merging it into master branch ?

This would help the migration of this repository main branch from release/1.0.0 to master branch.

@@ -54,7 +54,7 @@ def build(year: int) -> None:
#
# On crée une df par entité par période.
# Elles sont stockées dans un fichier h5
final.create_input_data_frame(year = year)
final.create_input_data_frame(year = year,export_flattened_df=True)
Copy link
Member

Choose a reason for hiding this comment

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

space after comma

@@ -15,7 +15,7 @@


@temporary_store_decorator(file_name = 'erfs_fpr')
def create_input_data_frame(temporary_store = None, year = None):
def create_input_data_frame(temporary_store = None, year = None,export_flattened_df=False):
Copy link
Member

Choose a reason for hiding this comment

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

space after comma

@@ -95,7 +95,11 @@ def create_input_data_frame(temporary_store = None, year = None):
)

individus = format_ids_and_roles(individus)

if export_flattened_df:
supermerge=individus.merge(menages,right_index=True,left_on="idmen",suffixes=("","_x"))
Copy link
Member

Choose a reason for hiding this comment

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

space around = and after commas.

if export_flattened_df:
supermerge=individus.merge(menages,right_index=True,left_on="idmen",suffixes=("","_x"))
print(len(individus),len(supermerge))
supermerge.to_hdf("dummy_data.h5",key="input")
Copy link
Member

Choose a reason for hiding this comment

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

"dummy_data.h5" should be an additional argument

@sandcha sandcha requested a review from benjello October 21, 2019 15:10
@sandcha
Copy link
Contributor Author

sandcha commented Oct 22, 2019

@benjello Do you agree with the last commit (aka 3b0b471) or would you like to discuss it in a new PR?

@benjello
Copy link
Member

Actually it would be better to check it carefully. But I do not have much time right now.
May be setting some test could help ...

@sandcha
Copy link
Contributor Author

sandcha commented Oct 24, 2019

Thx @magemax for last commit removal (discussed now in #178).
Merging.

@sandcha sandcha merged commit 3c83b06 into release/1.0.0 Oct 24, 2019
@sandcha sandcha deleted the flatten_erfs_fpr branch October 24, 2019 10:31
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