Skip to content

Commit

Permalink
chore: minor adjustemtns
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed May 9, 2024
1 parent d51a49b commit 6441d79
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"\n",
"USE_CONVENTIONAL_CELL = True # if True, the surface plane is constructed using miller indices of the conventional cell\n",
"\n",
"IS_TERMINATION_SELECTION_INTERACTIVE = True # if True, the user can select the termination interactively\n",
"IS_TERMINATION_SELECTION_INTERACTIVE = False # if True, the user can select the termination interactively\n",
"TERMINATION_INDEX = 0 # the default termination index that is used if no termination selected, ignored in interactive mode"
]
},
Expand Down Expand Up @@ -323,7 +323,7 @@
"# Could be either the termination as tuple, e.g. `('Ni_P6/mmm_1', 'C_C2/m_2')` or its index: `0`\n",
"termination_or_its_index = selected_termination\n",
"# select the first interface with the lowest strain and the smallest number of atoms\n",
"interfaces_slice_range_or_index = slice(0, 1)\n",
"interfaces_slice_range_or_index = slice(0, 10)\n",
"selected_interfaces = interface_data_holder.get_interfaces_as_materials(termination_or_its_index, interfaces_slice_range_or_index)"
],
"metadata": {
Expand Down Expand Up @@ -368,6 +368,23 @@
"\n",
"set_data(\"materials\", selected_interfaces)"
]
},
{
"cell_type": "code",
"outputs": [],
"source": [],
"metadata": {
"collapsed": false
},
"execution_count": null
},
{
"cell_type": "code",
"outputs": [],
"source": [],
"metadata": {
"collapsed": false
}
}
],
"metadata": {
Expand Down
4 changes: 2 additions & 2 deletions utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ def process_selected_index(selected_index_str: str, array: List[Any], element_na
selected_index = int(selected_index_str)
except ValueError:
print("Invalid input. Please enter a valid integer.")
return None # Return None to indicate failure
return None

if selected_index < 0 or selected_index >= len(array):
print("Invalid index.")
return None # Return None to indicate failure
return None

print(f"Selected {element_name}: ", array[selected_index])
return array[selected_index]
Expand Down

0 comments on commit 6441d79

Please sign in to comment.