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 start and end datetimes to Item.__init__ #918

Merged
merged 2 commits into from
Feb 1, 2023

Conversation

gadomski
Copy link
Member

@gadomski gadomski commented Nov 10, 2022

Related Issue(s):

Description:

It's pretty awkward to provide start_datetime and end_datetime as strings in properties, when you can provide a datetime object as datetime. This PR adds two optional arguments to set start_datetime and end_datetime in the constructor. These values will override anything set in properties.

PR Checklist:

  • Code is formatted (run pre-commit run --all-files)
  • Tests pass (run scripts/test)
  • Documentation has been updated to reflect changes, if applicable
  • This PR maintains or improves overall codebase code coverage.
  • Changes are added to the CHANGELOG. See the docs for information about adding to the changelog.

@codecov-commenter
Copy link

codecov-commenter commented Nov 10, 2022

Codecov Report

Base: 94.31% // Head: 94.32% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (b47637f) compared to base (aa7048e).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #918   +/-   ##
=======================================
  Coverage   94.31%   94.32%           
=======================================
  Files          80       80           
  Lines       11923    11937   +14     
  Branches     1130     1132    +2     
=======================================
+ Hits        11245    11259   +14     
  Misses        496      496           
  Partials      182      182           
Impacted Files Coverage Δ
pystac/item.py 88.94% <100.00%> (+0.22%) ⬆️
tests/test_item.py 99.56% <100.00%> (+0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@gadomski gadomski force-pushed the issues/905-start-end-datetime branch from 7a5deda to ddfd53b Compare November 10, 2022 22:25
@gadomski gadomski self-assigned this Dec 30, 2022
@gadomski gadomski force-pushed the issues/905-start-end-datetime branch from e415c10 to 802944a Compare December 30, 2022 18:37
@gadomski gadomski added this to the 1.7 milestone Dec 30, 2022
@gadomski gadomski force-pushed the issues/905-start-end-datetime branch from 802944a to c304b27 Compare January 23, 2023 16:19
@gadomski gadomski requested a review from pjhartzell January 30, 2023 22:04
@gadomski gadomski force-pushed the issues/905-start-end-datetime branch from c304b27 to a86fab0 Compare January 30, 2023 22:05
These values allow you to pass a datetime, instead of having to convert it to a
string and put it into properties.
@gadomski gadomski force-pushed the issues/905-start-end-datetime branch from a86fab0 to b2821ce Compare January 30, 2023 22:06
Copy link
Collaborator

@pjhartzell pjhartzell left a comment

Choose a reason for hiding this comment

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

Looks good.

@gadomski gadomski merged commit cdb90b5 into main Feb 1, 2023
@gadomski gadomski deleted the issues/905-start-end-datetime branch February 1, 2023 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants