Skip to content

Commit

Permalink
Make sure datetime fix for deprecated utcnow works with older python
Browse files Browse the repository at this point in the history
  • Loading branch information
esoteric-ephemera committed Apr 3, 2024
1 parent 24eeb15 commit 90183de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions emmet-core/emmet/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
import re
from collections import OrderedDict
from datetime import datetime, UTC
from datetime import datetime, timezone
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Union

Expand Down Expand Up @@ -417,7 +417,7 @@ class TaskDoc(StructureMetadata, extra="allow"):
)

last_updated: Optional[datetime] = Field(
datetime.now(UTC),
datetime.now(timezone.UTC),
description="Timestamp for the most recent calculation for this task document",
)

Expand Down Expand Up @@ -690,7 +690,7 @@ def get_entry(
"data": {
"oxide_type": oxide_type(calcs_reversed[0].output.structure),
"aspherical": calcs_reversed[0].input.parameters.get("LASPH", False),
"last_updated": str(datetime.now(UTC)),
"last_updated": str(datetime.now(timezone.UTC)),
},
}
return ComputedEntry.from_dict(entry_dict)
Expand Down

0 comments on commit 90183de

Please sign in to comment.