Skip to content
Open
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
8 changes: 5 additions & 3 deletions cmake/environmentchecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ else ()
find_program(INSTALL_NAME_TOOL_EXE NAMES ${PREFERRED_INSTALL_NAME_TOOL_NAMES} install_name_tool)

if(Python_Interpreter_FOUND)
if(NOT DEFINED TEST_COVERAGE_RESULT)
set(TEST_COVERAGE_RESULT -1 CACHE INTERNAL "Result of testing for Python coverage.")
if(NOT DEFINED TEST_COVERAGE_RESULT OR NOT TEST_COVERAGE_RESULT STREQUAL "0")
set(TEST_COVERAGE_RESULT "-1" CACHE INTERNAL "Result of testing for Python coverage.")
message(STATUS "Performing Test HAVE_COVERAGE")
get_filename_component(PYTHON_DIR ${Python_EXECUTABLE} DIRECTORY)
execute_process(COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/python_package_check.py exclude-until-coverage-plugin
RESULT_VARIABLE TEST_COVERAGE_RESULT OUTPUT_QUIET ERROR_QUIET)
if(TEST_COVERAGE_RESULT EQUAL 0)
# Update TEST_COVERATE_RESULT with test outcome.
set(TEST_COVERAGE_RESULT ${TEST_COVERAGE_RESULT} CACHE INTERNAL "Result of testing for Python coverage." FORCE)
if(TEST_COVERAGE_RESULT STREQUAL "0")
set(HAVE_COVERAGE TRUE)
message(STATUS "Performing Test HAVE_COVERAGE - Success")
else()
Expand Down
22 changes: 22 additions & 0 deletions src/api/libcellml/issue.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ class LIBCELLML_EXPORT Issue
MESSAGE
};

/**
* @brief Get the string version of a @ref Level.
*
* Return the string version of a @ref Level.
*
* @param level The level for which we want the string version.
*
* @return The string version of the @ref Level.
*/
static std::string levelAsString(Level level);

/**
* @brief The issue Reference enum class.
*
Expand Down Expand Up @@ -231,6 +242,17 @@ class LIBCELLML_EXPORT Issue
UNSPECIFIED
};

/**
* @brief Get the string version of a @ref ReferenceRule.
*
* Return the string version of a @ref ReferenceRule.
*
* @param rule The reference rule for which we want the string version.
*
* @return The string version of the @ref ReferenceRule.
*/
static std::string referenceRuleAsString(ReferenceRule rule);

/**
* @brief Get the description for this issue.
*
Expand Down
24 changes: 24 additions & 0 deletions src/api/libcellml/units.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ class LIBCELLML_EXPORT Units: public NamedEntity, public ImportedEntity
YOCTO
};

/**
* @brief Get the string version of a @ref Prefix.
*
* Return the string version of a @ref Prefix.
*
* @param prefix The prefix for which we want the string version.
*
* @return The string version of the @ref Prefix.
*/

static std::string prefixAsString(Prefix prefix);

/**
* @brief The Standard Unit enum class.
*
Expand Down Expand Up @@ -151,6 +163,18 @@ class LIBCELLML_EXPORT Units: public NamedEntity, public ImportedEntity
WEBER /**< Derived SI unit weber. */
};

/**
* @brief Get the string version of a @ref StandardUnit.
*
* Return the string version of a @ref StandardUnit.
*
* @param unit The unit for which we want the string version.
*
* @return The string version of the @ref StandardUnit.
*/

static std::string standardUnitAsString(StandardUnit unit);

/**
* @brief Test to determine if Units is a base unit.
*
Expand Down
12 changes: 12 additions & 0 deletions src/api/libcellml/variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ class LIBCELLML_EXPORT Variable: public NamedEntity
PUBLIC_AND_PRIVATE
};

/**
* @brief Get the string version of a @ref InterfaceType.
*
* Return the string version of a @ref InterfaceType.
*
* @param type The type for which we want the string version.
*
* @return The string version of the @ref InterfaceType.
*/

static std::string interfaceTypeAsString(InterfaceType type);

/**
* @brief Add each argument variable to the other's equivalent variable set.
*
Expand Down
6 changes: 6 additions & 0 deletions src/bindings/interface/issue.i
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ Level::ERROR will be returned.";
"Returns the CellML 2.0 Specification heading associated with the
:class:`ReferenceRule` for this issue (empty string if not set).";

%feature("docstring") libcellml::Issue::referenceRuleAsString
"Get the string version of a :class:`ReferenceRule`.";

%feature("docstring") libcellml::Issue::levelAsString
"Get the string version of a :class:`Level`.";

%{
#include "libcellml/issue.h"
%}
Expand Down
2 changes: 1 addition & 1 deletion src/bindings/interface/types.i
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Provides support for shared pointers declared in types.h.
if (!SWIG_IsOK(ecode)) {
%argument_fail(ecode, "$type", $symname, $argnum);
} else {
if (val < %static_cast($type::UNDEFINED, int) || %static_cast($type::MAP_VARIABLES_IDENTICAL_UNIT_REDUCTION, int) < val) {
if (val < %static_cast($type::UNDEFINED, int) || %static_cast($type::UNSPECIFIED, int) < val) {
%argument_fail(ecode, "$type is not a valid value for the enumeration.", $symname, $argnum);
}
$1 = %static_cast(val, $basetype);
Expand Down
6 changes: 6 additions & 0 deletions src/bindings/interface/units.i
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ extract the units with the given `name`.";
%feature("docstring") libcellml::Units::unitAttributeMultiplier
"Get the multiplier from the unit attribute.";

%feature("docstring") libcellml::Units::prefixAsString
"Get the string version of a :class:`Prefix`.";

%feature("docstring") libcellml::Units::standardUnitAsString
"Get the string version of a :class:`StandardUnit`.";

#if defined(SWIGPYTHON)
// Treat negative size_t as invalid index (instead of unknown method)
%extend libcellml::Units {
Expand Down
3 changes: 3 additions & 0 deletions src/bindings/interface/variable.i
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ not equivalent the connection identifier is not set.";
%feature("docstring") libcellml::Variable::clone
"Create a copy of this variable.";

%feature("docstring") libcellml::Variable::interfaceTypeAsString
"Get the string version of a :class:`InterfaceType`.";

#if defined(SWIGPYTHON)
// Treat negative size_t as invalid index (instead of unknown method)
%extend libcellml::Variable {
Expand Down
Loading
Loading