Skip to content

Commit

Permalink
Merge branch 'feature/8116_fltabs_code_tidy' of
Browse files Browse the repository at this point in the history
github.com:mantidproject/mantid into feature/8116_fltabs_code_tidy

Conflicts:
	Code/Mantid/scripts/Inelastic/IndirectAbsCor.py

Refs #8116
  • Loading branch information
Samuel Jackson committed Nov 4, 2013
2 parents 48ed2cc + 8ea6f97 commit 0236140
Show file tree
Hide file tree
Showing 725 changed files with 131,643 additions and 30,414 deletions.
6 changes: 3 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
*.xml hooks.MaxObjectKiB130902=2048

# Allowing gSoap generated files to be committed.
/Code/Mantid/Framework/ICat/inc/MantidICat/ICat3/GSoapGenerated/ICat3H.h hooks.MaxObjectKiB130819=2048
/Code/Mantid/Framework/ICat/src/ICat3/GSoapGenerated/ICat3C.cpp hooks.MaxObjectKiB130819=5120
/Code/Mantid/Framework/ICat/src/ICat4/GSoapGenerated/ICat4C.cpp hooks.MaxObjectKiB130819=2048
/Code/Mantid/Framework/ICat/inc/MantidICat/ICat3/GSoapGenerated/ICat3H.h hooks.MaxObjectKiB131025=2048
/Code/Mantid/Framework/ICat/src/ICat3/GSoapGenerated/ICat3C.cpp hooks.MaxObjectKiB131025=5120
/Code/Mantid/Framework/ICat/src/ICat4/GSoapGenerated/ICat4C.cpp hooks.MaxObjectKiB131025=2048
10 changes: 7 additions & 3 deletions Code/Mantid/Build/CMake/DarwinSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ set ( PVPLUGINS_DIR MantidPlot.app/pvplugins )
set ( PVPLUGINS_SUBDIR pvplugins ) # Need to tidy these things up!

# Python packages
set ( PYTHON_PACKAGES_DIR ${CMAKE_LIBRARY_PATH}/Python )

install ( PROGRAMS /Library/Python/${PY_VER}/site-packages/sip.so DESTINATION ${BIN_DIR} )
# Explicitly specify which PyQt libraries we want because just taking the whole
Expand All @@ -75,8 +74,13 @@ install ( FILES /Library/Python/${PY_VER}/site-packages/PyQt4/Qt.so
/Library/Python/${PY_VER}/site-packages/PyQt4/__init__.py
DESTINATION ${BIN_DIR}/PyQt4 )
install ( DIRECTORY /Library/Python/${PY_VER}/site-packages/PyQt4/uic DESTINATION ${BIN_DIR}/PyQt4 )
# nxs package
install ( DIRECTORY ${PYTHON_PACKAGES_DIR}/nxs DESTINATION ${BIN_DIR} )

# Python packages in Third_Party need copying to build directory and the final package
file ( GLOB THIRDPARTY_PYTHON_PACKAGES ${CMAKE_LIBRARY_PATH}/Python/* )
foreach ( PYPACKAGE ${THIRDPARTY_PYTHON_PACKAGES} )
install ( DIRECTORY ${PYPACKAGE} DESTINATION ${BIN_DIR} )
file ( COPY ${PYPACKAGE} DESTINATION ${PROJECT_BINARY_DIR}/bin )
endforeach( PYPACKAGE )

install ( DIRECTORY ${QT_PLUGINS_DIR}/imageformats DESTINATION MantidPlot.app/Contents/Frameworks/plugins )

Expand Down
9 changes: 7 additions & 2 deletions Code/Mantid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ if ( ENABLE_CPACK )
include ( CPackCommon )

# Mac Packagemaker settings
set ( CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/Installers/MacInstaller/MacOSX-README.rtf )
if (OSX_VERSION VERSION_LESS 10.8)
set ( CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/Installers/MacInstaller/MacOSX-README.rtf )
else()
set ( CPACK_RESOURCE_FILE_README ${CMAKE_SOURCE_DIR}/Installers/MacInstaller/MacOSX10-8-README.rtf )
endif ()
set ( CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/Installers/WinInstaller/License.rtf )

IF ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
Expand All @@ -184,7 +188,8 @@ if ( ENABLE_CPACK )
# rhel requirements
set ( CPACK_RPM_PACKAGE_REQUIRES "boost >= 1.34.1,qt4 >= 4.2,nexus,nexus-python,qwt,gsl,glibc,qwtplot3d-qt4,OpenCASCADE-libs-modelling >= 6.3.0,OpenCASCADE-libs-foundation >= 6.3.0,OpenCASCADE-libs-visualization >= 6.3.0,OpenCASCADE-libs-ocaf >= 6.3.0,OpenCASCADE-libs-ocaf-lite >= 6.3.0,muParser,numpy" )
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},poco-crypto,poco-data,poco-mysql,poco-sqlite,poco-odbc,poco-util,poco-xml,poco-zip,poco-net,poco-netssl,poco-foundation,PyQt4,sip" )
# scipy & matplotlib (ipython is too low a version to be used)
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},python-ipython >= 1.1.0" )
# scipy & matplotlib
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},scipy,python-matplotlib" )
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},mxml,hdf,hdf5" )

Expand Down
1 change: 1 addition & 0 deletions Code/Mantid/Framework/API/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ set ( TEST_FILES
IEventListTest.h
IFunction1DTest.h
IFunctionMDTest.h
IkedaCarpenterModeratorTest.h
ILiveListenerTest.h
IMDWorkspaceTest.h
ISpectrumTest.h
Expand Down
14 changes: 14 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/Algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ class MANTID_API_DLL Algorithm : public IAlgorithm, public Kernel::PropertyManag
virtual const std::string categorySeparator() const {return ";";}
/// function to return any aliases to the algorithm; A default implementation is provided
virtual const std::string alias() const {return "";}

const std::string workspaceMethodName() const;
const std::vector<std::string> workspaceMethodOn() const;
const std::string workspaceMethodInputProperty() const;

/// Algorithm ID. Unmanaged algorithms return 0 (or NULL?) values. Managed ones have non-zero.
AlgorithmID getAlgorithmID()const{return m_algorithmID;}

Expand Down Expand Up @@ -218,6 +223,12 @@ class MANTID_API_DLL Algorithm : public IAlgorithm, public Kernel::PropertyManag
void setLogging(const bool value){g_log.setEnabled(value);}
///returns the status of logging, True = enabled
bool isLogging() const {return g_log.getEnabled();}

///sets the logging priority offset
void setLoggingOffset(const int value) {g_log.setLevelOffset(value);}
///returns the logging priority offset
int getLoggingOffset() const {return g_log.getLevelOffset();}

/// Returns a reference to the logger.
Kernel::Logger& getLogger() const { return g_log; }

Expand Down Expand Up @@ -267,6 +278,9 @@ class MANTID_API_DLL Algorithm : public IAlgorithm, public Kernel::PropertyManag
/// Method defining summary, optional
virtual void initDocs() {};

/// Returns a semi-colon separated list of workspace types to attach this algorithm
virtual const std::string workspaceMethodOnTypes() const { return ""; }

void cacheWorkspaceProperties();

friend class AlgorithmProxy;
Expand Down
10 changes: 10 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/AlgorithmProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ namespace Mantid
void enableHistoryRecordingForChild(const bool) {};
void setRethrows(const bool rethrow);

const std::string workspaceMethodName() const;
const std::vector<std::string> workspaceMethodOn() const;
const std::string workspaceMethodInputProperty() const;

/** @name PropertyManager methods */
//@{
/// Set the property value
Expand All @@ -120,6 +124,11 @@ namespace Mantid
void setLogging(const bool value) { m_isLoggingEnabled=value; }
/// Is the algorithm have logging enabled
bool isLogging() const { return m_isLoggingEnabled; }

///returns the logging priority offset
void setLoggingOffset(const int value) { m_loggingOffset=value; }
///returns the logging priority offset
int getLoggingOffset() const { return m_loggingOffset; }

///setting the child start progress
void setChildStartProgress(const double startProgress)const;
Expand Down Expand Up @@ -162,6 +171,7 @@ namespace Mantid
mutable boost::shared_ptr<Algorithm> m_alg; ///< Shared pointer to a real algorithm. Created on demand
bool m_isExecuted; ///< Executed flag
bool m_isLoggingEnabled;///< is the logging of the underlying algorithm enabled
int m_loggingOffset; ///< the logging priority offset
bool m_rethrow; ///< Whether or not to rethrow exceptions.
bool m_isChild; ///< Is this a child algo

Expand Down
7 changes: 7 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/FileLoaderRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ namespace Mantid
m_log.debug() << "Registered '" << nameVersion.first << "' version '" << nameVersion.second << "' as file loader\n";
}

/// Unsubscribe a named algorithm and version from the loader registration
void unsubscribe(const std::string &name, const int version = -1);

/// Returns the name of an Algorithm that can load the given filename
const boost::shared_ptr<IAlgorithm> chooseLoader(const std::string &filename) const;
/// Checks whether the given algorithm can load the file
Expand Down Expand Up @@ -121,6 +124,10 @@ namespace Mantid
}
};

/// Remove a named algorithm & version from the given map
void removeAlgorithm(const std::string & name, const int version,
std::multimap<std::string,int> & typedLoaders);

/// The list of names. The index pointed to by LoaderFormat defines a set for that format
std::vector<std::multimap<std::string,int> > m_names;
/// Total number of names registered
Expand Down
16 changes: 15 additions & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/IAlgorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ class MANTID_API_DLL IAlgorithm : virtual public Kernel::IPropertyManager
/// function to return any aliases of the algorithm.
virtual const std::string alias() const = 0;

/** @name Algorithms As Methods */
///@{
/// Returns a name that will be used when attached as a workspace method. Empty string indicates do not attach
virtual const std::string workspaceMethodName() const = 0;
/// Returns a set of class names that will have the method attached. Empty list indicates all types
virtual const std::vector<std::string> workspaceMethodOn() const = 0;
/// Returns the name of the input workspace property used by the calling object
virtual const std::string workspaceMethodInputProperty() const = 0;
///@}

/// Algorithm ID. Unmanaged algorithms return 0 (or NULL?) values. Managed ones have non-zero.
virtual AlgorithmID getAlgorithmID()const = 0;

Expand Down Expand Up @@ -149,7 +159,11 @@ class MANTID_API_DLL IAlgorithm : virtual public Kernel::IPropertyManager
///Logging can be disabled by passing a value of false
virtual void setLogging(const bool value) = 0;
///returns the status of logging, True = enabled
virtual bool isLogging() const = 0;
virtual bool isLogging() const = 0;
///gets the logging priority offset
virtual void setLoggingOffset(const int value) = 0;
///returns the logging priority offset
virtual int getLoggingOffset() const = 0;
///setting the child start progress
virtual void setChildStartProgress(const double startProgress)const = 0;
/// setting the child end progress
Expand Down
2 changes: 2 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/IBackgroundFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class DLLExport IBackgroundFunction : public IFunctionWithLocation
virtual void fit(const std::vector<double>& X,const std::vector<double>& Y) = 0;
};

typedef boost::shared_ptr<IBackgroundFunction> IBackgroundFunction_sptr;

} // namespace API
} // namespace Mantid

Expand Down
4 changes: 3 additions & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/IDomainCreator.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace Mantid
virtual void initialize(Kernel::IPropertyManager* , const std::string&, DomainType) {}

/// Toggle output of either just composite or composite + members
void separateCompositeMembersInOutput(const bool value);
void separateCompositeMembersInOutput(const bool value, const bool conv = false);

/// Declare properties that specify the dataset within the workspace to fit to.
/// @param suffix :: A suffix to give to all new properties.
Expand Down Expand Up @@ -117,6 +117,8 @@ namespace Mantid
DomainType m_domainType;
/// Output separate composite function values
bool m_outputCompositeMembers;
/// Perform convolution of output composite components
bool m_convolutionCompositeMembers;
/// Flag to ignore nans, infinities and zero errors.
bool m_ignoreInvalidData;
};
Expand Down
2 changes: 2 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/LogManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ namespace Mantid

/// Empty the values out of all TimeSeriesProperty logs
void clearTimeSeriesLogs();
/// Empty all but the last value out of all TimeSeriesProperty logs
void clearOutdatedTimeSeriesLogValues();

/// Save the run to a NeXus file with a given group name
virtual void saveNexus(::NeXus::File * file, const std::string & group,bool keepOpen=false) const;
Expand Down
4 changes: 3 additions & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/ScriptRepository.h
Original file line number Diff line number Diff line change
Expand Up @@ -550,10 +550,12 @@ They will work as was expected for folders @ref folders-sec.
@param option: flag to set for auto-update, or not. If true, new versions of the path will replace the local file as soon as they are available at the central repository.
@return int: number of files changed (because of the cascading of folders)
@exception ScriptRepoException : Invalid entry.
*/
virtual void setAutoUpdate(const std::string & path, bool option = true) = 0;
virtual int setAutoUpdate(const std::string & path, bool option = true) = 0;


};
Expand Down
43 changes: 42 additions & 1 deletion Code/Mantid/Framework/API/src/Algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ namespace Mantid
{
namespace API
{
namespace
{
/// Separator for workspace types in workspaceMethodOnTypes member
const std::string WORKSPACE_TYPES_SEPARATOR = ";";
}

// Doxygen can't handle member specialization at the moment: https://bugzilla.gnome.org/show_bug.cgi?id=406027
// so we have to ignore them
///@cond
Expand Down Expand Up @@ -213,7 +219,7 @@ namespace Mantid
Poco::StringTokenizer tokenizer(category(), categorySeparator(),
Poco::StringTokenizer::TOK_TRIM | Poco::StringTokenizer::TOK_IGNORE_EMPTY);
Poco::StringTokenizer::Iterator h = tokenizer.begin();

for (; h != tokenizer.end(); ++h)
{
res.push_back(*h);
Expand All @@ -227,6 +233,40 @@ namespace Mantid
return res;
}

/**
* @return A string giving the method name that should be attached to a workspace
*/
const std::string Algorithm::workspaceMethodName() const
{
return "";
}

/**
*
* @return A list of workspace class names that should have the workspaceMethodName attached
*/
const std::vector<std::string> Algorithm::workspaceMethodOn() const
{
Poco::StringTokenizer tokenizer(this->workspaceMethodOnTypes(), WORKSPACE_TYPES_SEPARATOR,
Poco::StringTokenizer::TOK_TRIM | Poco::StringTokenizer::TOK_IGNORE_EMPTY);
std::vector<std::string> res;
res.reserve(tokenizer.count());
for( auto iter = tokenizer.begin(); iter != tokenizer.end(); ++iter )
{
res.push_back(*iter);
}

return res;
}

/**
* @return The name of the property that the calling object will be passed to.
*/
const std::string Algorithm::workspaceMethodInputProperty() const
{
return "";
}


//=============================================================================================
//================================== Initialization ===========================================
Expand Down Expand Up @@ -911,6 +951,7 @@ namespace Mantid
copyPropertiesFrom(proxy);
m_algorithmID = proxy.getAlgorithmID();
setLogging(proxy.isLogging());
setLoggingOffset(proxy.getLoggingOffset());
setChild(proxy.isChild());
}

Expand Down
29 changes: 28 additions & 1 deletion Code/Mantid/Framework/API/src/AlgorithmProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Mantid
PropertyManagerOwner(),_executeAsync(this,&AlgorithmProxy::executeAsyncImpl),
m_name(alg->name()),m_category(alg->category()), m_categorySeparator(alg->categorySeparator()),
m_alias(alg->alias()), m_version(alg->version()), m_alg(alg),
m_isExecuted(),m_isLoggingEnabled(true), m_rethrow(false),
m_isExecuted(),m_isLoggingEnabled(true), m_loggingOffset(0), m_rethrow(false),
m_isChild(false)
{
if (!alg)
Expand Down Expand Up @@ -183,6 +183,33 @@ namespace Mantid
if(m_alg) m_alg->setRethrows(rethrow);
}

/**
* @return A string giving the method name that should be attached to a workspace
*/
const std::string AlgorithmProxy::workspaceMethodName() const
{
if(m_alg) return m_alg->workspaceMethodName();
else return "";
}

/**
* @return A set of workspace class names that should have the workspaceMethodName attached
*/
const std::vector<std::string> AlgorithmProxy::workspaceMethodOn() const
{
if(m_alg) return m_alg->workspaceMethodOn();
else return std::vector<std::string>();
}

/**
* @return The name of the property that the calling object will be passed to
*/
const std::string AlgorithmProxy::workspaceMethodInputProperty() const
{
if(m_alg) return m_alg->workspaceMethodInputProperty();
else return "";
}

/**
* Override setPropertyValue
* @param name The name of the property
Expand Down

0 comments on commit 0236140

Please sign in to comment.