-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
4,203 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "plugins/CashFlow"] | ||
path = plugins/CashFlow | ||
url = https://hpcgitlab.hpc.inl.gov/RAVEN_PLUGINS/CashFlow.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
before_script: | ||
# Print out python version for debugging | ||
- python -V | ||
# set up proxy for runner user | ||
- export http_proxy=http://webbalance.inl.gov:8080; | ||
export https_proxy=http://webbalance.inl.gov:8080; | ||
export ftp_proxy=http://webbalance.inl.gov:8080; | ||
export ftps_proxy=http://webbalance.inl.gov:8080; | ||
# clone raven | ||
- git clone https://github.com/idaholab/raven.git | ||
- cd raven | ||
- git checkout master | ||
- git clean -xfd | ||
# check that we have conda | ||
- export PATH=$HOME/miniconda2/bin:$PATH | ||
- if which conda 2> /dev/null; then | ||
echo "Conda found!"; | ||
conda update conda; | ||
else | ||
echo "ERROR Conda not found!"; | ||
exit 404; | ||
fi | ||
# create libraries or create them | ||
- ./scripts/establish_conda_env.sh --install --conda-defs $HOME/miniconda2/etc/profile.d/conda.sh | ||
# check python installation | ||
- which python | ||
- python -V | ||
- ./build_raven | ||
# Install CashFlow branch ... | ||
- python ./scripts/install_plugins.py -s ../ | ||
# return to project path main dir | ||
- cd .. | ||
|
||
test: | ||
script: | ||
- cd raven | ||
- ./run_tests -j4 --plugins --no-color |
25 changes: 25 additions & 0 deletions
25
plugins/CashFlow/.gitlab/issue_templates/ISSUE_TEMPLATE.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
-------- | ||
Issue Description | ||
-------- | ||
##### Please describe your issue here. | ||
|
||
|
||
|
||
|
||
---------------- | ||
For Change Control Board: Issue Review | ||
---------------- | ||
This review should occur before any development is performed as a response to this issue. | ||
- [ ] 1. Is it tagged with a type: defect or improvement? | ||
- [ ] 2. Is it tagged with a priority: critical, normal or minor? | ||
- [ ] 3. If it is a defect, can it cause wrong results for users? If so an email needs to be sent to the users. | ||
- [ ] 4. Is a rationale provided? (Such as explaining why the improvement is needed or why current code is wrong.) | ||
|
||
------- | ||
For Change Control Board: Issue Closure | ||
------- | ||
This review should occur when the issue is imminently going to be closed. | ||
- [ ] 1. If the issue is a defect, is the defect fixed? | ||
- [ ] 2. If the issue is a defect, is the defect tested for in the regression test system? (If not explain why not.) | ||
- [ ] 3. If the issue can impact users, has an email to the users group been written (the email should specify if the defect impacts stable or master)? | ||
- [ ] 4. If the issue is being closed without a merge request, has an explanation of why it is being closed been provided? |
19 changes: 19 additions & 0 deletions
19
plugins/CashFlow/.gitlab/merge_request_templates/PULL_REQUEST_TEMPLATE.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-------- | ||
Pull Request Description | ||
-------- | ||
##### What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.) | ||
|
||
|
||
##### What are the significant changes in functionality due to this change request? | ||
|
||
|
||
---------------- | ||
For Change Control Board: Change Request Review | ||
---------------- | ||
The following review must be completed by an authorized member of the Change Control Board. | ||
- [ ] 1. Review all computer code. | ||
- [ ] 2. If any changes occur to the input syntax, there must be an accompanying change to the user manual. If the input syntax change deprecates existing input files, a conversion script needs to be added. | ||
- [ ] 3. Make sure the Python code and commenting standards are respected (camelBack, etc.) - See on the [wiki](https://github.com/idaholab/raven/wiki/RAVEN-Code-Standards#python) for details. | ||
- [ ] 4. Regression tests have to complete successfully. | ||
- [ ] 5. If significant functionality is added, there must be tests added to check this. Tests should cover all possible options. Multiple short tests are preferred over one large test. | ||
- [ ] 6. The merge request must reference an issue. If the issue is closed, the issue close checklist shall be done. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
This is the git repository for CashFlow. | ||
CashFlow is a plugin for the RAVEN code. | ||
|
||
The plugin enables the capability to compute the NPV (Net Present Value), the IRR (Internal Rate of Return) and the PI (Profitability Index) with RAVEN. Furthermore, it is possible to do an NPV, IRR or PI search, i.e. CashFlow will compute a multiplicative value (for example the production cost) so that the NPV, IRR or PI has a desired value. The plugin allows for a generic definition of cash flows which drivers are provided by RAVEN. Furthermore, CashFlow includes flexible options to deal with taxes, inflation, discounting and offers capabilities to compute a combined cash flow for components with different component lives. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from CashFlow.src import Amortization | ||
from CashFlow.src import CashFlow_ExtMod | ||
from CashFlow.src import CashFlows | ||
from CashFlow.src import CashFlowUser | ||
from CashFlow.src import main as CashFlow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
To compile the manual, type | ||
>make | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
\section{Installation} | ||
\label{sec:Installation} | ||
|
||
This section of the manual describes how to install the 'Economics for RAVEN' plug-in and use it from within RAVEN \cite{RAVEN}. | ||
|
||
\subsection{Installing the plug-in} | ||
The CashFlow plugin is distributed with RAVEN. If you just want to use the plugin and are not interested in developing additional features or bug-fixes for it, just make sure that you have access to the plugin repository and you will automatically get it when installing RAVEN. | ||
For more information, please refere to the RAVEN manual. | ||
|
||
\subsection{Accessing the plug-in from within RAVEN} | ||
The plugin can be accessed as a special subtype of the External model. The syntax is given in Listing \ref{lst:CashFlowfromRAVEN}. | ||
|
||
\begin{lstlisting}[style=XML,morekeywords={anAttribute},caption=Call CashFlow from RAVEN input., label=lst:CashFlowfromRAVEN] | ||
<ExternalModel name="Cash_Flow" subType="CashFlow.CashFlow"> | ||
<variables> Input and output variables needed by CashFlow </variables> | ||
<ExternalXML node="Economics" xmlToLoad="Cash_Flow_input.xml"/> | ||
</ExternalModel> | ||
\end{lstlisting} | ||
|
||
\subsection{Running the plugin as a stand-alone python code} | ||
|
||
In addition to accessing the plug-in from within RAVEN, it can also be run as a stand-alone python program. This is useful for example for testing. However, since CashFlow is still a RAVEN plugin, RAVEN needs to be installed and the plugin needs to be in the plugin-folder for that to work. | ||
|
||
Assuming RAVEN is installed and the plugin is in the proper directory (execution will generate an error if its not), one can run it using the command shown in Listing \ref{lst:CashFlowAsCode}. | ||
|
||
\small | ||
\begin{lstlisting}[caption=CashFlow run as stand-alone python code, label=lst:CashFlowAsCode] | ||
~/raven --> python plugins/CashFlow/src/CashFlow_ExtMode.py -h | ||
usage: Cash_Flow.py [-h] -iXML inp_file -iINP inp_file -o out_file | ||
|
||
Run RAVEN CashFlow plugin as stand-alone code | ||
|
||
arguments: | ||
-h, --help show this help message and exit | ||
-iXML inp_file XML CashFlow input file name | ||
-iINP inp_file CashFlow input file name with the input | ||
variable list | ||
-o out_file Output file name | ||
\end{lstlisting} | ||
\normalsize | ||
|
||
The XML CashFlow input is the one that contains the component and cash flow definitions, i.e. the one in \xmlAttr{xmlToLoad} in Listing \ref{lst:CashFlowfromRAVEN}. | ||
|
||
The CashFlow input file contains the variables that RAVEN provides when using the CashFlow as a plugin, i.e. the cash flow drivers and multipliers. Listing \ref{lst:CashFlowInputFile} shows an example of the CashFlow input file for the cash flow definitions given in Listing \ref{lst:InputExample}. | ||
|
||
\begin{lstlisting}[caption=CashFlow run as stand-alone python code, label=lst:CashFlowInputFile] | ||
Cfdriver1 5.5 | ||
multiplier1 1.0 | ||
Cfdriver2 10.8 | ||
multiplier2 2.0 | ||
\end{lstlisting} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
SRCFILE = user_manual | ||
MANUAL_FILES = user_manual.tex | ||
LATEX_FLAGS=-interaction=nonstopmode | ||
|
||
all: Economics_for_RAVEN_user_manual.pdf | ||
|
||
Economics_for_RAVEN_user_manual.pdf: $(MANUAL_FILES) version.tex | ||
pdflatex $(LATEX_FLAGS) $(SRCFILE).tex | ||
bibtex $(SRCFILE) | ||
pdflatex $(LATEX_FLAGS) $(SRCFILE).tex | ||
pdflatex $(LATEX_FLAGS) $(SRCFILE).tex | ||
|
||
.PHONY: clean | ||
|
||
clean: | ||
@rm -f *~ *.aux *.bbl *.blg *.log *.out *.toc *.lot *.lof $(SRCFILE).pdf | ||
|
||
#creating version file | ||
version.tex : $(MANUAL_FILES) | ||
git log -1 --format="%H %an %aD" .. > version.tex | ||
|
||
|
Oops, something went wrong.