Skip to content

Commit

Permalink
Some minor cleaning up.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Oct 21, 2019
1 parent 3286db2 commit 53165d6
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 22 deletions.
Expand Up @@ -313,7 +313,8 @@ PyObject * DataStorePythonWrapper::newNumPyArray(DataStoreArray *pDataStoreArray

//==============================================================================

PyObject * DataStorePythonWrapper::newNumPyArray(DataStoreVariable *pDataStoreVariable, const int &pRun)
PyObject * DataStorePythonWrapper::newNumPyArray(DataStoreVariable *pDataStoreVariable,
int pRun)
{
if (pDataStoreVariable && pDataStoreVariable->array(pRun)) {
auto numpyArray = new NumpyPythonWrapper(pDataStoreVariable->array(pRun), pDataStoreVariable->size());
Expand All @@ -328,7 +329,7 @@ PyObject * DataStorePythonWrapper::newNumPyArray(DataStoreVariable *pDataStoreVa
//==============================================================================

double DataStorePythonWrapper::value(DataStoreVariable *pDataStoreVariable,
const quint64 &pPosition, const int &pRun) const
const quint64 &pPosition, int pRun) const
{
if (pDataStoreVariable && pDataStoreVariable->array()) {
return pDataStoreVariable->value(pPosition, pRun);
Expand All @@ -339,7 +340,8 @@ double DataStorePythonWrapper::value(DataStoreVariable *pDataStoreVariable,

//==============================================================================

PyObject * DataStorePythonWrapper::values(DataStoreVariable *pDataStoreVariable, const int &pRun) const
PyObject * DataStorePythonWrapper::values(DataStoreVariable *pDataStoreVariable,
int pRun) const
{
return DataStorePythonWrapper::newNumPyArray(pDataStoreVariable, pRun);
}
Expand Down
9 changes: 5 additions & 4 deletions src/plugins/dataStore/DataStore/src/datastorepythonwrapper.h
Expand Up @@ -51,18 +51,18 @@ class DataStorePythonWrapper : public QObject

static DATASTORE_EXPORT PyObject * newNumPyArray(DataStoreArray *pDataStoreArray);
static DATASTORE_EXPORT PyObject * newNumPyArray(DataStoreVariable *pDataStoreVariable,
const int &pRun);
int pRun = -1);

static DATASTORE_EXPORT PyObject *dataStoreValuesDict(const DataStoreValues *pDataStoreValues,
SimulationSupport::SimulationDataUpdatedFunction *pSimulationDataUpdatedFunction = nullptr);
static DATASTORE_EXPORT PyObject *dataStoreVariablesDict(const DataStoreVariables &pDataStoreVariables);

public slots:
double value(OpenCOR::DataStore::DataStoreVariable *pDataStoreVariable,
const quint64 &pPosition, const int &pRun = -1) const;
const quint64 &pPosition, int pRun = -1) const;

PyObject * values(OpenCOR::DataStore::DataStoreVariable *pDataStoreVariable,
const int &pRun = -1) const;
int pRun = -1) const;

PyObject * variables(OpenCOR::DataStore::DataStore *pDataStore);
PyObject * voiAndVariables(OpenCOR::DataStore::DataStore *pDataStore);
Expand All @@ -75,7 +75,8 @@ class NumpyPythonWrapper : public QObject
Q_OBJECT

public:
explicit NumpyPythonWrapper(DataStoreArray *pDataStoreArray, quint64 pSize=0);
explicit NumpyPythonWrapper(DataStoreArray *pDataStoreArray,
quint64 pSize = 0);
~NumpyPythonWrapper();

PyObject * numpyArray() const;
Expand Down
Expand Up @@ -108,7 +108,7 @@ class SimulationExperimentViewInformationParametersWidget : public Core::Propert
void graphRequired(CellMLSupport::CellmlFileRuntimeParameter *pParameterX,
CellMLSupport::CellmlFileRuntimeParameter *pParameterY);

void calculateGradients(const int &pIndex, const bool &pCalculate);
void calculateGradients(int pIndex, bool pCalculate);

public slots:
void updateParameters(double pCurrentPoint);
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/solver/CVODESolver/src/cvodesolver.cpp
Expand Up @@ -153,8 +153,7 @@ void CvodeSolver::initialize(double pVoi, int pRatesStatesCount,
double *pConstants, double *pRates,
double *pStates, double *pAlgebraic,
ComputeRatesFunction pComputeRates,
const int &pGradientsCount,
int *pGradientsIndices,
int pGradientsCount, int *pGradientsIndices,
double *pGradients)
{
// Retrieve our properties
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/solver/CVODESolver/src/cvodesolver.h
Expand Up @@ -143,8 +143,7 @@ class CvodeSolver : public OpenCOR::Solver::OdeSolver
void initialize(double pVoi, int pRatesStatesCount, double *pConstants,
double *pRates, double *pStates, double *pAlgebraic,
ComputeRatesFunction pComputeRates,
const int &pGradientsCount,
int *pGradientsIndices,
int pGradientsCount, int *pGradientsIndices,
double *pGradients) override;
void reinitialize(double pVoi) override;

Expand Down
3 changes: 1 addition & 2 deletions src/plugins/solverinterface.cpp
Expand Up @@ -126,8 +126,7 @@ void OdeSolver::initialize(double pVoi, int pRatesStatesCount,
double *pConstants, double *pRates, double *pStates,
double *pAlgebraic,
ComputeRatesFunction pComputeRates,
const int &pGradientsCount,
int *pGradientsIndices,
int pGradientsCount, int *pGradientsIndices,
double *pGradients)
{
Q_UNUSED(pGradientsCount);
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/solverinterface.h
Expand Up @@ -85,8 +85,7 @@ class OdeSolver : public Solver
double *pConstants, double *pRates, double *pStates,
double *pAlgebraic,
ComputeRatesFunction pComputeRates,
const int &pGradientsCount,
int *pGradientsIndices,
int pGradientsCount, int *pGradientsIndices,
double *pGradients);

virtual void reinitialize(double pVoi);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/support/SimulationSupport/src/simulation.cpp
Expand Up @@ -789,7 +789,7 @@ void SimulationData::deleteArrays()

//==============================================================================

void SimulationData::setGradientCalculationByIndex(const int &pIndex, bool pCalculate)
void SimulationData::setGradientCalculationByIndex(int pIndex, bool pCalculate)
{
// Keep track of the indices of constant parameters that will
// have gradients calculated
Expand Down
5 changes: 3 additions & 2 deletions src/plugins/support/SimulationSupport/src/simulation.h
Expand Up @@ -205,8 +205,9 @@ public slots:
bool isModified() const;
void checkForModifications();

void setGradientCalculation(const QString &pConstantUri, bool pCalculate = true);
void setGradientCalculationByIndex(const int &pIndex, bool pCalculate);
void setGradientCalculation(const QString &pConstantUri,
bool pCalculate = true);
void setGradientCalculationByIndex(int pIndex, bool pCalculate);

void updateInitialValues();

Expand Down
Expand Up @@ -2764,8 +2764,7 @@ bool GraphPanelPlotWidget::isOptimizedAxes() const

//==============================================================================

void GraphPanelPlotWidget::optimizeAxis(const int &pAxisId, double &pMin,
double &pMax,
void GraphPanelPlotWidget::optimizeAxis(int pAxisId, double &pMin, double &pMax,
Optimization pOptimization)
{
// Make sure that the given values are different (and therefore optimisable
Expand Down
Expand Up @@ -656,7 +656,7 @@ class GRAPHPANELWIDGET_EXPORT GraphPanelPlotWidget : public QwtPlot,

QRectF realDataRect();

void optimizeAxis(const int &pAxisId, double &pMin, double &pMax,
void optimizeAxis(int pAxisId, double &pMin, double &pMax,
Optimization pOptimization);

void setAxis(int pAxisId, double pMin, double pMax);
Expand Down

0 comments on commit 53165d6

Please sign in to comment.