Skip to content

Commit

Permalink
add get_*item_count
Browse files Browse the repository at this point in the history
  • Loading branch information
sverhoeven committed Oct 31, 2023
1 parent 4f3a158 commit 8bba72f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
20 changes: 12 additions & 8 deletions example_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -150,7 +150,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -184,7 +184,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -193,7 +193,7 @@
"'Sfincs hydrodynamic model (C)'"
]
},
"execution_count": 21,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -213,14 +213,14 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": []
},
"execution_count": 28,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -231,7 +231,7 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -276,7 +276,9 @@
{
"data": {
"text/plain": [
"{'get_input_var_names': ('zs', 'zb', 'qtsrc', 'zst_bnd'),\n",
"{'get_input_item_count': 4,\n",
" 'get_output_item_count': 6,\n",
" 'get_input_var_names': ('zs', 'zb', 'qtsrc', 'zst_bnd'),\n",
" 'get_output_var_names': ('z_xz', 'z_yz', 'zs', 'zb', 'qtsrc', 'zst_bnd'),\n",
" 'get_var_grid': 0,\n",
" 'get_var_itemsize': 4,\n",
Expand All @@ -293,6 +295,8 @@
"source": [
"# Var methods\n",
"{\n",
" 'get_input_item_count': model.get_input_item_count(),\n",
" 'get_output_item_count': model.get_output_item_count(),\n",
" 'get_input_var_names': model.get_input_var_names(),\n",
" 'get_output_var_names': model.get_output_var_names(),\n",
" 'get_var_grid': model.get_var_grid('zs'),\n",
Expand Down
6 changes: 2 additions & 4 deletions src/sfincs_bmi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,10 @@ std::string SfincsBmi::GetComponentName() {
return "Sfincs hydrodynamic model (C)";
}
int SfincsBmi::GetInputItemCount() {
// TODO: implement
throw NotImplemented();
return this->GetInputVarNames().size();
}
int SfincsBmi::GetOutputItemCount() {
// TODO: implement
throw NotImplemented();
return this->GetOutputVarNames().size();
}
std::vector<std::string> SfincsBmi::GetInputVarNames() {
// TODO: get from fortran
Expand Down

0 comments on commit 8bba72f

Please sign in to comment.