Skip to content

Commit

Permalink
add conc indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
yalinli2 committed Sep 15, 2021
1 parent b239653 commit 87aec8f
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 51 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ _build
prof
*Pyreverse*
monkeytype.sqlite3

# Spyder
*.spyproject*

# Docs #
Expand Down
78 changes: 39 additions & 39 deletions docs/source/tutorials/3_WasteStream.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"This tutorial is made with qsdsan v0.3.2.\n"
"This tutorial is made with qsdsan v0.3.5.\n"
]
}
],
Expand Down Expand Up @@ -260,7 +260,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -270,7 +270,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -368,7 +368,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -409,7 +409,7 @@
" <H2O: 981.47 kg/hr>])"
]
},
"execution_count": 11,
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -424,7 +424,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 13,
"metadata": {},
"outputs": [
{
Expand All @@ -451,7 +451,7 @@
" 1.200e-02, 5.448e+01])"
]
},
"execution_count": 12,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -465,7 +465,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 14,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -508,7 +508,7 @@
" <H2O: 0.9844 m^3/hr>])"
]
},
"execution_count": 13,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -521,7 +521,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 15,
"metadata": {},
"outputs": [
{
Expand All @@ -539,7 +539,7 @@
" 1.200e+01, 9.815e+05])"
]
},
"execution_count": 14,
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -551,7 +551,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 16,
"metadata": {},
"outputs": [
{
Expand All @@ -572,7 +572,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 17,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -634,7 +634,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 18,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -666,7 +666,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 19,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -731,7 +731,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -742,7 +742,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 21,
"metadata": {},
"outputs": [
{
Expand All @@ -759,7 +759,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 22,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -772,7 +772,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 23,
"metadata": {},
"outputs": [
{
Expand All @@ -798,7 +798,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 24,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -831,7 +831,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 25,
"metadata": {},
"outputs": [
{
Expand All @@ -840,7 +840,7 @@
"251.9652894584042"
]
},
"execution_count": 24,
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -853,7 +853,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -866,7 +866,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 27,
"metadata": {},
"outputs": [
{
Expand All @@ -889,7 +889,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 28,
"metadata": {},
"outputs": [
{
Expand All @@ -916,7 +916,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 29,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -925,7 +925,7 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 30,
"metadata": {},
"outputs": [
{
Expand All @@ -934,7 +934,7 @@
"77.01571037585582"
]
},
"execution_count": 29,
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -947,7 +947,7 @@
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 31,
"metadata": {},
"outputs": [
{
Expand All @@ -956,7 +956,7 @@
"0.0"
]
},
"execution_count": 30,
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -968,7 +968,7 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 32,
"metadata": {},
"outputs": [
{
Expand All @@ -977,7 +977,7 @@
"0.0"
]
},
"execution_count": 31,
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -989,7 +989,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 33,
"metadata": {},
"outputs": [
{
Expand All @@ -998,7 +998,7 @@
"80.62889262668934"
]
},
"execution_count": 32,
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1010,7 +1010,7 @@
},
{
"cell_type": "code",
"execution_count": 33,
"execution_count": 34,
"metadata": {},
"outputs": [
{
Expand All @@ -1019,7 +1019,7 @@
"485.2265687216927"
]
},
"execution_count": 33,
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1031,7 +1031,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 35,
"metadata": {},
"outputs": [
{
Expand All @@ -1040,7 +1040,7 @@
"13.99807163657801"
]
},
"execution_count": 34,
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -1074,7 +1074,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.2"
"version": "3.8.11"
}
},
"nbformat": 4,
Expand Down
13 changes: 11 additions & 2 deletions qsdsan/_sanunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,17 @@ def results(self, with_units=True, include_utilities=True,
results.loc[('Additional OPEX', ''), :] = ('USD/hr', 0)
else:
for k, v in self.add_OPEX.items():
try: results.loc[(k, ''), :] = ('USD/hr', v)
except: breakpoint()
if not with_units:
results.loc[(k, '')] = v
else:
try: results.loc[(k, ''), :] = ('USD/hr', v)
# When `results` is a series instead of dataframe,
# might not need this
except ValueError:
results = results.to_frame(name=self.ID)
results.insert(0, 'Units', '')
results.loc[(k, ''), :] = ('USD/hr', v)
results.columns.name = type(self).__name__
if with_units:
results.replace({'USD': f'{currency}', 'USD/hr': f'{currency}/hr'},
inplace=True)
Expand Down

0 comments on commit 87aec8f

Please sign in to comment.