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

Initial data model #1

Merged
merged 11 commits into from
Nov 8, 2022
Merged

Initial data model #1

merged 11 commits into from
Nov 8, 2022

Conversation

rlskoeser
Copy link
Member

@rlskoeser rlskoeser commented Nov 7, 2022

included in this PR:

  • initial implementation for uncertain / partially known dates (single date and date interval)
  • unit tests for a few simple cases for single dates and date ranges (initialize & convert to string)
  • readme instructions for installation and running unit tests
  • GitHub Actions workflow for running unit tests

notes

  • we came up with the provisional name "undate" for uncertain / unknown dates
  • initial implementation uses datetime for convenience even though we know it has some limitations; would be great to have test cases outside of the range supported by datetime so we can rework the internals and persist existing behavior articulated in the tests
  • a test is failing in CI that works locally; I think the CI behavior is wrong? not sure what's causing the difference
  • string methods are currently a mix of ISO 8601 and EDTF (sorry about that); probably need to separate those out into methods that make the format explicit

@maltevogl
Copy link
Member

In my local env the same pytest assertion fails.


def test_open_range():
# 900 -
assert str(UndateInterval(Undate(900))) == "0900/"
Copy link
Member

Choose a reason for hiding this comment

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

This can be fixed by removing the leading 0 : "0900/" -> "900/". Is this a cleaning that you where expecting? I think this goes back to how edtf treads leading zeros, but it is not yet implemented.

@maltevogl
Copy link
Member

Looks good to me as a start now.

@rlskoeser rlskoeser merged commit 67b8165 into main Nov 8, 2022
@rlskoeser rlskoeser deleted the initial-data-model branch November 8, 2022 14:17
@jdamerow
Copy link
Member

jdamerow commented Nov 8, 2022

For me the tests are failing now. It expects 0900/.
AssertionError: assert '0900/' == '900/'

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.

4 participants