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

Add Datetime Logger #1

Merged
merged 4 commits into from
Aug 20, 2024
Merged

Add Datetime Logger #1

merged 4 commits into from
Aug 20, 2024

Conversation

PaulineMauryL
Copy link
Contributor

No description provided.

@PaulineMauryL PaulineMauryL changed the title add tests for detetime Add Datetime Logger Aug 19, 2024
result_json = serialise_constraints(example_constraints)
expected_json = """{"module": "smartnoise-synth", "version": "1.0.4", "constraints": {"birthdays": {"type": "_ssynth_datetime_transformer:DateTimeTransformer", "params": {"epoch": "1970-01-01T00:00:00"}}}}""" # noqa
expected_json_updated = expected_json.replace(
"1.0.4", pkg_resources.get_distribution(SSYNTH).version

Choose a reason for hiding this comment

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

nice! i guess we could use the same logic for the measurement pipeline in our test with opendp. Instead of updating each time we use a new version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah yes ^^ let's be lazy

# "date": ChainTransformer(
# [DateTimeTransformer(), MinMaxTransformer(nullable=False)]
# ),
"date": DateTimeTransformer(epoch="1993-06-04"),

Choose a reason for hiding this comment

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

not sure to fully understand the epoch. For what i understand, its the date of reference during the transformation from date to float (nb of days since reference - 1970-01-01 being 0 by default). Is it only testing this aspect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here it is testing that the serialiser works also when given another start date of reference, so from what I understand in this case 0 would start the "1993-06-04".
But I am just testing the de/serialiser works not the underlying library

@PaulineMauryL PaulineMauryL merged commit a6c6056 into main Aug 20, 2024
1 check passed
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.

2 participants