Accept list[str] for thermo_types in ThermoRester.search()#729
Conversation
|
Am I causing this error? > raise MPRestError(
f"REST query returned with error status code {response.status_code} "
f"on URL {response.url} with message:\n{message}"
)
E mp_api.client.core.client.MPRestError: REST query returned with error status code 504 on URL https://api.materialsproject.org/materials/?deprecated=False&crystal_system=Cubic&_all_fields=True&_limit=1 with message:
E Server timed out trying to obtain data. Try again with a smaller request. |
|
Thank you for this @janosh, this looks great. The test failures aren't your fault. Something happened server-side so I am re-running. I'll merge once they all finish! |
|
No problem. You prob know this but just in case not, you can enable auto-merge in the repo settings which will show a button below PRs to auto-merge as soon as CI passes. |
|
Just wanna give a +1 on merging this. I would much rather be passing a string :) |
|
Would also like to say that it would be nice if the available |
|
@mattmcdermott You do get to see valid types from the error msg if you pass an invalid one. But I think you're right, they should also be in the doc string. |
Let me know if I should add a test for this.
Also, I just used
strin the type hint as usingLiteralwould break single source of truth for accepted values. But happy to change that if you preferLiteral.