I am encountering an issue with the Materials Project API while querying structures using refinery.populate_structures_(api_key=api_key, elements=elements)
. It is part of my senior thesis project which is due soon. I would appreciate any guidance on resolving this issue.
This function was working correctly yesterday, but today I am getting the following error:
File ~/.local/lib/python3.12/site-packages/mp_api/client/core/client.py:122, in BaseRester.init(self, api_key, endpoint, include_user_agent, session, s3_client, debug, monty_decode, use_document_model, timeout, headers, mute_progress_bars)
120 self.headers = headers or {}
121 self.mute_progress_bars = mute_progress_bars
→ 122 self.db_version = BaseRester._get_database_version(self.endpoint)
124 if self.suffix:
125 self.endpoint = urljoin(self.endpoint, self.suffix)
File ~/.local/lib/python3.12/site-packages/mp_api/client/core/client.py:226, in BaseRester._get_database_version(endpoint)
224 date_str = requests.get(url=endpoint + “heartbeat”).json()[“db_version”]
225 # Convert the string to a datetime object
→ 226 date_obj = datetime.strptime(date_str, “%Y.%m.%d”)
228 # Format the datetime object as a string
229 formatted_date = date_obj.strftime(“%Y.%m.%d”)
File ~/miniconda3/lib/python3.12/_strptime.py:554, in _strptime_datetime(cls, data_string, format)
551 def _strptime_datetime(cls, data_string, format=“%a %b %d %H:%M:%S %Y”):
552 “”“Return a class cls instance based on the input string and the
553 format string.”“”
→ 554 tt, fraction, gmtoff_fraction = _strptime(data_string, format)
555 tzname, gmtoff = tt[-2:]
556 args = tt[:6] + (fraction,)
File ~/miniconda3/lib/python3.12/_strptime.py:336, in _strptime(data_string, format)
333 raise ValueError("time data %r does not match format r"
334 (data_string, format))
335 if len(data_string) != found.end():
→ 336 raise ValueError("unconverted data remains: s"
337 data_string[found.end():])
339 iso_year = year = None
340 month = day = 1
ValueError: unconverted data remains: .post