|
32 | 32 | "\n", |
33 | 33 | "We follow the below steps:\n", |
34 | 34 | "\n", |
35 | | - "- Import materials from [materials project](https://materialsproject.org/)\n", |
| 35 | + "- Import materials from [Materials Bank](https://docs.mat3ra.com/materials/bank/)\n", |
36 | 36 | "\n", |
37 | 37 | "- Group imported materials inside a [materials set](https://docs.mat3ra.com/entities-general/sets/)\n", |
38 | 38 | "\n", |
|
49 | 49 | "The explanation below assumes that the reader is familiar with the concepts used in Mat3ra platform and RESTful API. We outline these below and direct the reader to the original sources of information:\n", |
50 | 50 | "\n", |
51 | 51 | "- [Generating RESTful API authentication parameters](../system/get_authentication_params.ipynb)\n", |
52 | | - "- [Importing materials from materials project](../material/import_materials_from_materialsproject.ipynb)\n", |
| 52 | + "- [Importing materials from Materials Bank](../material/get_materials_by_formula.ipynb)\n", |
53 | 53 | "- [Creating and submitting jobs](../job/create_and_submit_job.ipynb)" |
54 | 54 | ] |
55 | 55 | }, |
|
68 | 68 | "\n", |
69 | 69 | "ACCOUNT_ID and AUTH_TOKEN - Authentication parameters needed for when making requests to [Mat3ra.com's API Endpoints](https://docs.mat3ra.com/rest-api/endpoints/).\n", |
70 | 70 | "\n", |
71 | | - "MATERIALS_PROJECT_API_KEY - Authentication parameter needed for when making requests to [Material Project's API](https://materialsproject.org/open)\n", |
72 | | - "\n", |
73 | 71 | "ORGANIZATION_ID - Authentication parameter needed for when working with collaborative accounts https://docs.mat3ra.com/collaboration/organizations/overview/\n", |
74 | 72 | "\n", |
75 | 73 | "> <span style=\"color: orange\">**NOTE**</span>: If you are running this notebook from Jupyter, the variables ACCOUNT_ID, AUTH_TOKEN, MATERIALS_PROJECT_API_KEY, and ORGANIZATION_ID should be set in the file [settings.json](../../utils/settings.json) if you need to use these variables. To obtain API token parameters, please see the following link to the documentation explaining how to get them: https://docs.mat3ra.com/accounts/ui/preferences/api/" |
|
91 | 89 | "# @title Authorization Form\n", |
92 | 90 | "ACCOUNT_ID = \"ACCOUNT_ID\" # @param {type:\"string\"}\n", |
93 | 91 | "AUTH_TOKEN = \"AUTH_TOKEN\" # @param {type:\"string\"}\n", |
94 | | - "MATERIALS_PROJECT_API_KEY = \"MATERIALS_PROJECT_API_KEY\" # @param {type:\"string\"}\n", |
95 | 92 | "ORGANIZATION_ID = \"ORGANIZATION_ID\" # @param {type:\"string\"}\n", |
96 | 93 | "\n", |
97 | 94 | "import os\n", |
|
102 | 99 | " dict(\n", |
103 | 100 | " ACCOUNT_ID=ACCOUNT_ID,\n", |
104 | 101 | " AUTH_TOKEN=AUTH_TOKEN,\n", |
105 | | - " MATERIALS_PROJECT_API_KEY=MATERIALS_PROJECT_API_KEY,\n", |
106 | 102 | " ORGANIZATION_ID=ORGANIZATION_ID,\n", |
107 | 103 | " )\n", |
108 | 104 | " )\n", |
|
116 | 112 | " dict(\n", |
117 | 113 | " ACCOUNT_ID=apiConfig.get(\"accountId\"),\n", |
118 | 114 | " AUTH_TOKEN=apiConfig.get(\"authToken\"),\n", |
119 | | - " MATERIALS_PROJECT_API_KEY=MATERIALS_PROJECT_API_KEY,\n", |
120 | 115 | " ORGANIZATION_ID=apiConfig.get(\"organizationId\") or \"\",\n", |
121 | 116 | " )\n", |
122 | 117 | " )\n", |
|
152 | 147 | "from IPython.display import IFrame\n", |
153 | 148 | "\n", |
154 | 149 | "# Import settings file and utils file\n", |
155 | | - "from utils.settings import ENDPOINT_ARGS, ACCOUNT_ID, MATERIALS_PROJECT_API_KEY\n", |
| 150 | + "from utils.settings import ENDPOINT_ARGS, ACCOUNT_ID\n", |
156 | 151 | "from utils.generic import wait_for_jobs_to_finish, get_property_by_subworkflow_and_unit_indicies, dataframe_to_html\n", |
157 | 152 | "\n", |
158 | 153 | "import pandas as pd\n", |
|
163 | 158 | "from exabyte_api_client.endpoints.projects import ProjectEndpoints\n", |
164 | 159 | "from exabyte_api_client.endpoints.materials import MaterialEndpoints\n", |
165 | 160 | "from exabyte_api_client.endpoints.bank_workflows import BankWorkflowEndpoints\n", |
| 161 | + "from exabyte_api_client.endpoints.bank_materials import BankMaterialEndpoints\n", |
166 | 162 | "from exabyte_api_client.endpoints.properties import PropertiesEndpoints" |
167 | 163 | ] |
168 | 164 | }, |
|
175 | 171 | "source": [ |
176 | 172 | "#### Materials\n", |
177 | 173 | "\n", |
178 | | - "- **MATERIALS_PROJECT_IDS**: a list of material IDs to be imported from materials project\n", |
| 174 | + "- **MATERIALS_SI_QUERY**: query to find Silicon materials in Materials Bank\n", |
| 175 | + "- **MATERIALS_GE_QUERY**: query to find Germanium materials in Materials Bank\n", |
179 | 176 | "- **TAGS**: a list of [tags](https://docs.mat3ra.com/entities-general/data/#tags) to assign to imported materials\n", |
180 | 177 | "- **MATERIALS_SET_NAME**: the name of the materials set\n" |
181 | 178 | ] |
|
188 | 185 | }, |
189 | 186 | "outputs": [], |
190 | 187 | "source": [ |
191 | | - "MATERIALS_PROJECT_IDS = [\"mp-149\", \"mp-32\"] # Si and Ge\n", |
| 188 | + "# Materials Bank queries for Si and Ge\n", |
| 189 | + "MATERIAL_SI_QUERY = {\"formula\": \"Si\"}\n", |
| 190 | + "MATERIAL_GE_QUERY = {\"formula\": \"Ge\"}\n", |
192 | 191 | "MATERIALS_SET_NAME = \"materials-set\"\n", |
193 | 192 | "TAGS = [\"tag1\", \"tag2\"]" |
194 | 193 | ] |
|
326 | 325 | "project_endpoints = ProjectEndpoints(*ENDPOINT_ARGS)\n", |
327 | 326 | "material_endpoints = MaterialEndpoints(*ENDPOINT_ARGS)\n", |
328 | 327 | "property_endpoints = PropertiesEndpoints(*ENDPOINT_ARGS)\n", |
329 | | - "bank_workflow_endpoints = BankWorkflowEndpoints(*ENDPOINT_ARGS)" |
| 328 | + "bank_workflow_endpoints = BankWorkflowEndpoints(*ENDPOINT_ARGS)\n", |
| 329 | + "bank_material_endpoints = BankMaterialEndpoints(*ENDPOINT_ARGS)" |
330 | 330 | ] |
331 | 331 | }, |
332 | 332 | { |
|
384 | 384 | "source": [ |
385 | 385 | "### Import materials\n", |
386 | 386 | "\n", |
387 | | - "Import materials from materials project with the above tags." |
| 387 | + "Get materials from Materials Bank and copy to account's materials collection." |
388 | 388 | ] |
389 | 389 | }, |
390 | 390 | { |
|
395 | 395 | }, |
396 | 396 | "outputs": [], |
397 | 397 | "source": [ |
398 | | - "materials = material_endpoints.import_from_materialsproject(\n", |
399 | | - " MATERIALS_PROJECT_API_KEY, MATERIALS_PROJECT_IDS, owner_id, TAGS\n", |
400 | | - ")" |
| 398 | + "bank_si_material = bank_material_endpoints.list(MATERIAL_SI_QUERY)[0]\n", |
| 399 | + "bank_ge_material = bank_material_endpoints.list(MATERIAL_GE_QUERY)[0]\n", |
| 400 | + "materials = [bank_si_material, bank_ge_material]" |
401 | 401 | ] |
402 | 402 | }, |
403 | 403 | { |
|
0 commit comments