Fix datetime imports
In many places, we have used from datetime import datetime. This is bad, since it masks the module for further imports:
from datetime import datetime
from datetime.timezone import utc
Sorting these the other way around will cause complaints from flake8/ruff.
This PR changes all of these import to import datetime as dt, so we need on the single import to access other items:
import datetime as dt
dt.datetime(1980, 3, 19)
dt.timedelta(minutes=42)
now = dt.datetime.now(dt.timezone.utc)
This is a change that makes implementing the timezone aware datetimes of https://github.com/pytroll/satpy/issues/2752 easier.
- [ ] Closes #xxxx
- [ ] Tests added
- [ ] Fully documented
- [ ] Add your name to
AUTHORS.mdif not there already
Codecov Report
Attention: Patch coverage is 95.48611% with 26 lines in your changes missing coverage. Please review.
Project coverage is 95.94%. Comparing base (
aeb3391) to head (3b5e62c). Report is 507 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #2787 +/- ##
==========================================
+ Coverage 94.57% 95.94% +1.37%
==========================================
Files 379 379
Lines 53886 53842 -44
==========================================
+ Hits 50964 51661 +697
+ Misses 2922 2181 -741
| Flag | Coverage Δ | |
|---|---|---|
| behaviourtests | 4.09% <1.38%> (+<0.01%) |
:arrow_up: |
| unittests | 96.04% <95.81%> (+0.87%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Pull Request Test Coverage Report for Build 8783919300
Details
- 0 of 0 changed or added relevant lines in 0 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage remained the same at 0.0%
| Totals | |
|---|---|
| Change from base Build 8781051256: | 0.0% |
| Covered Lines: | 0 |
| Relevant Lines: | 0 |