Mantid
|
#include <NotebookBuilder.h>
Public Member Functions | |
const std::string | build (const std::string &ws_name, const std::string &ws_title, const std::string &ws_comment) |
build an ipython notebook from the history view More... | |
NotebookBuilder (const std::shared_ptr< HistoryView > &view, std::string versionSpecificity="old") | |
virtual | ~NotebookBuilder ()=default |
Private Member Functions | |
const std::string | buildAlgorithmString (const AlgorithmHistory_const_sptr &algHistory) |
Build the script output for a single algorithm. More... | |
void | buildChildren (std::vector< HistoryItem >::const_iterator &iter) |
Iterate over each of the items children and output them to the script. More... | |
const std::string | buildPropertyString (const Mantid::Kernel::PropertyHistory_const_sptr &propHistory) |
Build the script output for a single property. More... | |
void | writeHistoryToStream (std::vector< HistoryItem >::const_iterator &iter) |
Write out an algorithm to the notebook. More... | |
Private Attributes | |
const std::vector< HistoryItem > | m_historyItems |
std::unique_ptr< NotebookWriter > | m_nb_writer |
std::string | m_output |
std::string | m_versionSpecificity |
Definition at line 27 of file NotebookBuilder.h.
NotebookBuilder::NotebookBuilder | ( | const std::shared_ptr< HistoryView > & | view, |
std::string | versionSpecificity = "old" |
||
) |
Definition at line 28 of file NotebookBuilder.cpp.
|
virtualdefault |
const std::string NotebookBuilder::build | ( | const std::string & | ws_name, |
const std::string & | ws_title, | ||
const std::string & | ws_comment | ||
) |
build an ipython notebook from the history view
Build an ipython notebook for algorithms included in the history view.
ws_name | :: workspace name |
ws_title | :: workspace title |
ws_comment | :: workspace comment |
Definition at line 40 of file NotebookBuilder.cpp.
References m_historyItems, m_nb_writer, and writeHistoryToStream().
Referenced by Mantid::Algorithms::GenerateIPythonNotebook::exec().
|
private |
Build the script output for a single algorithm.
algHistory | :: pointer to an algorithm history object |
Definition at line 104 of file NotebookBuilder.cpp.
References buildPropertyString(), Mantid::Kernel::SingletonHolder< T >::Instance(), and m_versionSpecificity.
Referenced by writeHistoryToStream().
|
private |
Iterate over each of the items children and output them to the script.
This moves the iterator forward over each of the child records and writes them to the stream.
iter | :: reference to the iterator pointing to the vector of history items |
Definition at line 89 of file NotebookBuilder.cpp.
References m_historyItems, and writeHistoryToStream().
Referenced by writeHistoryToStream().
|
private |
Build the script output for a single property.
propHistory | :: reference to a property history object |
Definition at line 153 of file NotebookBuilder.cpp.
References Mantid::Kernel::Logger::debug(), Mantid::API::g_log, Mantid::Kernel::Direction::Output, and value.
Referenced by buildAlgorithmString().
|
private |
Write out an algorithm to the notebook.
If the entry is unrolled this will recurse and output the children of that entry instead. If not, it will just output the algorithm to the stream.
iter | :: reference to the iterator pointing to the vector of history items |
Definition at line 65 of file NotebookBuilder.cpp.
References buildAlgorithmString(), buildChildren(), and m_nb_writer.
Referenced by build(), and buildChildren().
|
private |
Definition at line 40 of file NotebookBuilder.h.
Referenced by build(), and buildChildren().
|
private |
Definition at line 43 of file NotebookBuilder.h.
Referenced by build(), and writeHistoryToStream().
|
private |
Definition at line 41 of file NotebookBuilder.h.
|
private |
Definition at line 42 of file NotebookBuilder.h.
Referenced by buildAlgorithmString().