assume-framework / assume

ASSUME - Agent-based Simulation for Studying and Understanding Market Evolution
https://assume.readthedocs.io
20 stars 5 forks source link

Fix datetime warning #302

Closed maurerle closed 5 months ago

maurerle commented 5 months ago

This drops the timezone information after conversion and therefore stays compliant with the current behavior. This is a follow-up to #285

It also includes tests for the helper functions, to make sure that they adhere to the offset correctly. Running the tests in CI might not be always helpful, as they probably run in UTC and therefore do not have weird issues.

The existing and current behavior is to always convert datetimes into UTC and never store the Timezone with them.

codecov[bot] commented 5 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (0f43e13) 76.94% compared to head (4b3e1b5) 76.96%.

Files Patch % Lines
assume/common/mango_serializer.py 50.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #302 +/- ## ========================================== + Coverage 76.94% 76.96% +0.01% ========================================== Files 41 41 Lines 4698 4702 +4 ========================================== + Hits 3615 3619 +4 Misses 1083 1083 ``` | [Flag](https://app.codecov.io/gh/assume-framework/assume/pull/302/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework) | Coverage Δ | | |---|---|---| | [pytest](https://app.codecov.io/gh/assume-framework/assume/pull/302/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework) | `76.96% <90.90%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=assume-framework#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

nick-harder commented 5 months ago

@maurerle I believe the problem is that the version of datetime for python 3.10 doesn't have UTC in it, that was also a problem for me, and why I considered dropping 3.10 version