Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alfoa/submodule #1146

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "plugins/CashFlow"]
path = plugins/CashFlow
url = git@hpcgitlab.hpc.inl.gov:RAVEN_PLUGINS/CashFlow.git
url = https://hpcgitlab.hpc.inl.gov/RAVEN_PLUGINS/CashFlow.git
1 change: 0 additions & 1 deletion plugins/CashFlow
Submodule CashFlow deleted from 9ffd3b
37 changes: 37 additions & 0 deletions plugins/CashFlow/.gitlab-ci.yml
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 plugins/CashFlow/.gitlab/issue_templates/ISSUE_TEMPLATE.md
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?
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.
5 changes: 5 additions & 0 deletions plugins/CashFlow/README.md
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.

5 changes: 5 additions & 0 deletions plugins/CashFlow/__init__.py
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
3 changes: 3 additions & 0 deletions plugins/CashFlow/doc/00README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
To compile the manual, type
>make

Binary file added plugins/CashFlow/doc/CashFlow_RAVEN_plugin.pptx
Binary file not shown.
52 changes: 52 additions & 0 deletions plugins/CashFlow/doc/Installation.tex
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}
22 changes: 22 additions & 0 deletions plugins/CashFlow/doc/Makefile
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


Loading