@@ -1258,21 +1258,41 @@ def get_charge_density_from_material_id(
12581258 task_id = latest_doc ["task_id" ]
12591259 return self .get_charge_density_from_task_id (task_id , inc_task_doc )
12601260
1261- def get_download_info (self , material_ids , calc_types = None , file_patterns = None ):
1261+ def get_download_info (
1262+ self ,
1263+ material_ids : str | MPID | list [str | MPID ],
1264+ calc_types : list [str | CalcType ] | None = None ,
1265+ file_patterns : list [str ] | None = None ,
1266+ ):
12621267 """Get a list of URLs to retrieve raw VASP output files from the NoMaD repository
12631268 Args:
1264- material_ids (list): list of material identifiers (mp-id's)
1265- task_types (list): list of task types to include in download (see CalcType Enum class)
1269+ material_ids (str or MPID, or list thereof ): list of material identifiers (mp-id's)
1270+ calc_types (list of str or CalcType ): list of calc types to include in download (see CalcType Enum class)
12661271 file_patterns (list): list of wildcard file names to include for each task
12671272 Returns:
12681273 a tuple of 1) a dictionary mapping material_ids to task_ids and
12691274 calc_types, and 2) a list of URLs to download zip archives from
12701275 NoMaD repository. Each zip archive will contain a manifest.json with
12711276 metadata info, e.g. the task/external_ids that belong to a directory.
12721277 """
1278+ warnings .warn (
1279+ "Full downloads of raw data are being transitioned to "
1280+ "Materials Project's AWS S3 OpenData buckets. "
1281+ "These features for accessing legacy raw data via NOMAD "
1282+ "are maintained but may not be supported in the future." ,
1283+ category = MPRestWarning ,
1284+ stacklevel = 2 ,
1285+ )
1286+
12731287 # task_id's correspond to NoMaD external_id's
1288+ if isinstance (material_ids , str | MPID ):
1289+ material_ids = [material_ids ]
1290+
12741291 calc_types = (
1275- [t .value for t in calc_types if isinstance (t , CalcType )]
1292+ [
1293+ t .value if isinstance (t , CalcType ) else CalcType (t ).value
1294+ for t in calc_types
1295+ ]
12761296 if calc_types
12771297 else []
12781298 )
0 commit comments