Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Commit

Permalink
- The seg-fault in rdesigneur tests are due to BhallaLab#388.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dilawar Singh committed Feb 25, 2020
1 parent 4e22887 commit 02d6d39
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 54 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ matrix:
include:
- os: linux
dist: bionic
services:
- xvfb
- os: osx
osx_image: xcode11.3

Expand All @@ -21,6 +23,7 @@ addons:
apt:
update: true


before_script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then nvm get head || true; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./.ci/travis_prepare_osx.sh; fi
Expand Down
72 changes: 41 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -409,15 +409,15 @@ foreach(_test_script ${PYDOC_TEST_SCRIPTS})
endforeach()


# CUSTOM TESTS. These tests may require some extra settings.
# Run python tests. These are fast tests.
set(PYMOOSE_TEST_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/py_custom)
add_test(NAME test_long_sbml_multi
COMMAND ${PYTHON_EXECUTABLE} ${PYMOOSE_TEST_DIRECTORY}/test_long_sbml+exp+parser+multithreaded.py
WORKING_DIRECTORY ${PYMOOSE_TEST_DIRECTORY}
)
set_tests_properties(test_long_sbml_multi PROPERTIES
ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}/python;MOOSE_NUM_THREADS=4")
## # CUSTOM TESTS. These tests may require some extra settings.
## # Run python tests. These are fast tests.
## set(PYMOOSE_TEST_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/py_custom)
## add_test(NAME test_long_sbml_multi
## COMMAND ${PYTHON_EXECUTABLE} ${PYMOOSE_TEST_DIRECTORY}/test_long_sbml+exp+parser+multithreaded.py
## WORKING_DIRECTORY ${PYMOOSE_TEST_DIRECTORY}
## )
## set_tests_properties(test_long_sbml_multi PROPERTIES
## ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}/python;MOOSE_NUM_THREADS=4")

# Alpha tests. These should not run by default.
set(MOOSE_ALPHA_TEST_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/alpha)
Expand Down Expand Up @@ -449,28 +449,6 @@ foreach(_test_script ${PY_ISSUES_SCRIPTS})
)
endforeach()

# add pylint target.
set(PYSCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/python )
file(GLOB_RECURSE PY_SCRIPTS "python/*.py")
add_custom_target(pylint)
foreach(_py_script ${PY_SCRIPTS})
get_filename_component( _py_name ${_py_script} NAME_WE)
file( READ ${_py_script} pytext)
string(MD5 _md5 "${pytext}")
set(TGT_NAME "${_py_name}-${_md5}" )
set(PYLINT_OPTIONS --disable=no-member --disable=no-name-in-module
--disable=invalid-unary-operand-type
--disable=import-error
--disable=no-method-argument
)
add_custom_target( ${TGT_NAME}
COMMAND ${PYTHON_EXECUTABLE} -m pylint -E ${PYLINT_OPTIONS} ${_py_script}
COMMENT "Running pylint on ${_py_script}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_dependencies(pylint ${TGT_NAME} )
endforeach( )

############################ CPACK ######################################
# This is not maintained anymore since packaging is done using OpenBuildService
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake_moose_cpack.cmake)
Expand Down Expand Up @@ -499,3 +477,35 @@ add_custom_target(upload DEPENDS sdist
${PYMOOSE_SDIST_FILE}
COMMENT "Uploading source distribution to PyPI"
VERBATIM)

####################### DEVELOPMENT ########################################

# PYLINT target.
set(PYSCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/python)
file(GLOB_RECURSE PY_SCRIPTS "python/*.py")
add_custom_target(pylint)
foreach(_py_script ${PY_SCRIPTS})
get_filename_component( _py_name ${_py_script} NAME_WE)
file( READ ${_py_script} pytext)
string(MD5 _md5 "${pytext}")
set(TGT_NAME "${_py_name}-${_md5}" )
set(PYLINT_OPTIONS --disable=no-member --disable=no-name-in-module
--disable=invalid-unary-operand-type
--disable=import-error
--disable=no-method-argument
)
add_custom_target( ${TGT_NAME}
COMMAND ${PYTHON_EXECUTABLE} -m pylint -E ${PYLINT_OPTIONS} ${_py_script}
COMMENT "Running pylint on ${_py_script}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_dependencies(pylint ${TGT_NAME} )
endforeach( )

# Replicate Travis-CI building using docker
add_custom_target(travis
COMMAND docker build -t bhallalab/travis:latest
-f ${CMAKE_CURRENT_SOURCE_DIR}/devel/docker/travis/Dockerfile .
COMMENT "Replicating Travis-CI building using Docker."
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM)
22 changes: 10 additions & 12 deletions devel/docker/travis/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
FROM ubuntu:xenial
FROM ubuntu:bionic
MAINTAINER Dilawar Singh <dilawars@ncbs.res.in>

# Install dependencies.
RUN apt update && apt install -y git cmake gcc g++ make vim-athena \
libboost-all-dev libgsl-dev \
RUN apt update && apt install -y cmake gcc g++ make \
libboost-all-dev libgsl-dev libblas-dev \
python3-pip python-pip \
python3-numpy python-numpy python3-matplotlib python-matplotlib \
python-tk python3-tk \
python-setuptools python3-setuptools \
python-dev python3-dev \
&& rm -rf /var/lib/apt/lists/*

RUN apt update && apt install -y python3-pip python-pip \
python3-numpy python-numpy \
python3-matplotlib python-matplotlib \
&& rm -rf /var/lib/apt/lists/*

RUN git config --global user.name "Dilawar Singh" \
&& git config --global user.email "dilawars@ncbs.res.in"
RUN git clone https://github.com/dilawar/vim ~/.vim -b minimal --depth 1
WORKDIR /root
RUN ls -ltrah
COPY . moose-core/
RUN ls -lta
RUN ls -ltarh
CMD cd moose-core && ./.ci/travis_build_linux.sh
3 changes: 1 addition & 2 deletions kinetics/PoolBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ const Cinfo* PoolBase::initCinfo()
static const Cinfo* poolCinfo = PoolBase::initCinfo();

//////////////////////////////////////////////////////////////
PoolBase::PoolBase()
: concInit_( 0.0 )
PoolBase::PoolBase() : concInit_( 0.0 )
{;}

PoolBase::~PoolBase()
Expand Down
1 change: 1 addition & 0 deletions kinetics/PoolBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class PoolBase

//////////////////////////////////////////////////////////////////
static const Cinfo* initCinfo();

private:
double concInit_; /// Initial concentration.
// We don't store the conc here as this is computed on the fly
Expand Down
20 changes: 11 additions & 9 deletions ksolve/Stoich.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,17 @@ const Cinfo* Stoich::initCinfo()
// MsgDest Definitions
//////////////////////////////////////////////////////////////
static DestFinfo unzombify( "unzombify",
"Restore all zombies to their native state",
new OpFunc0< Stoich >( &Stoich::unZombifyModel )
);
"Restore all zombies to their native state",
new OpFunc0< Stoich >( &Stoich::unZombifyModel )
);

static DestFinfo scaleBufsAndRates( "scaleBufsAndRates",
"Args: voxel#, volRatio\n"
"Handles requests for runtime volume changes in the specified "
"voxel#, Used in adaptors changing spine vols.",
new OpFunc2< Stoich, unsigned int, double >(
&Stoich::scaleBufsAndRates )
);
"Args: voxel#, volRatio\n"
"Handles requests for runtime volume changes in the specified "
"voxel#, Used in adaptors changing spine vols.",
new OpFunc2< Stoich, unsigned int, double >(
&Stoich::scaleBufsAndRates )
);

//////////////////////////////////////////////////////////////
// SrcFinfo Definitions
Expand Down Expand Up @@ -274,6 +275,7 @@ Stoich::Stoich()
Stoich::~Stoich()
{
unZombifyModel();

// Note that we cannot do the unZombify here, because it is too
// prone to problems with the ordering of the delete operations
// relative to the zombies.
Expand Down
1 change: 1 addition & 0 deletions ksolve/Stoich.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ class Stoich
//////////////////////////////////////////////////////////////////
static const unsigned int PoolIsNotOnSolver;
static const Cinfo* initCinfo();

private:
/**
* True if the stoich matrix is set up to handle only one-way
Expand Down

0 comments on commit 02d6d39

Please sign in to comment.