Skip to content

Commit

Permalink
Merge branch 'develop' of ssh://git.ecmwf.int/mag/magics
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvielamythepaut committed Jul 24, 2020
2 parents 7af6c22 + 2697282 commit 0e2c55e
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 83 deletions.
4 changes: 3 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ environment:
GIT_CLONE_DIR: $(ECMWF)\git
INSTALL_DIR: $(ECMWF)\install
MAGICS_SRC: $(GIT_CLONE_DIR)\magics
MAGICS_PYTHON_TESTS: $(MAGICS_SRC)\test\python
MAGICS_TESTS_SRC: ${MAGICS_SRC}/../magics-test
MAGICS_PYTHON_TESTS: $(MAGICS_TESTS_SRC)\test\gallery
MAGPLUS_HOME: $(INSTALL_DIR)
MAGICS_PYTHON_SRC: $(GIT_CLONE_DIR)\magics_python
ECBUILD_SRC: $(GIT_CLONE_DIR)\ecbuild
Expand Down Expand Up @@ -53,6 +54,7 @@ install:

# install magics-python src
- cmd: git clone -b master --depth 1 https://github.com/ecmwf/magics-python.git %MAGICS_PYTHON_SRC%
- cmd: git clone --depth 1 https://github.com/ecmwf/magics-test.git %MAGICS_TESTS_SRC%

# install linux utils
- cmd: conda install -c msys2 m2-bash ^
Expand Down
33 changes: 16 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,20 @@ matrix:
env:
MINICONDA_FILE="Miniconda3-latest-Linux-x86_64.sh"
PROJ4_PATH=~/miniconda3
CAIRO=""

- os: osx
osx_image: xcode10.1
addons:
homebrew:
packages:
- pango

env:
MINICONDA_FILE="Miniconda3-latest-MacOSX-x86_64.sh"
CAIRO="-D ENABLE_CAIRO=0"

env:
global:
- MAGICS_SRC=${TRAVIS_BUILD_DIR}
- MAGICS_PYTHON_SRC=${MAGICS_SRC}/../magics-python
- MAGICS_TEST_SRC=${MAGICS_SRC}/../magics-test
- MAGICS_PYTHON_TESTS=${MAGICS_SRC}/test/python
- MAGICS_PYTHON_TESTS=${MAGICS_TEST_SRC}/test/gallery
- ECBUILD_SRC=${MAGICS_SRC}/../ecbuild
- BUILD_DIR=${MAGICS_SRC}/build
- INSTALL_DIR=/tmp/install
Expand All @@ -56,7 +53,8 @@ before_install:
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
echo $(clang-format --version)
echo $(bash --version)
bash check_formatting.sh
echo "No check for now"
#bash check_formatting.sh
fi
# prepare install dir
- mkdir ${INSTALL_DIR}
Expand Down Expand Up @@ -86,10 +84,8 @@ install:
- conda install boost libnetcdf expat jinja2 xarray scipy cftime
- conda install -c conda-forge proj4=6 eccodes pytest cairo pango pip
# search for conda-installed libraries
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
export LDFLAGS="$LDFLAGS -L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib"
fi
- export LDFLAGS="$LDFLAGS -L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib"


#---------------------------------#
# build configuration #
Expand All @@ -98,17 +94,20 @@ install:
script:
# build
- mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
- echo "In build dir--> ${MAGICS_SRC}"
- cmake -D CMAKE_INSTALL_PREFIX=${INSTALL_DIR}
-D ENABLE_FORTRAN=0
${MAGICS_SRC}
${MAGICS_SRC} ${CAIRO}
- make -j2
- ctest -j2 --output-on-failure
- make install > /dev/null
# test
# - cd ${MAGICS_PYTHON_SRC}
# - pytest
- cd ${MAGICS_TEST_SRC}
- pytest
# test only on linux for now
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
echo "In build dir--> ${MAGICS_PYTHON_SRC}"
cd ${MAGICS_PYTHON_SRC}
pytest
fi
after_success:
# Run script to generate PNGs and push result to magics-tests
Expand Down
12 changes: 6 additions & 6 deletions src/decoders/ObsDecoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ class BufrMultiValueAccessor : public BufrAccessor {
virtual void operator()(const ObsDecoder&, MvObs& obs, double& val) const {
const BufrIdentifiers& table = BufrIdentTable::get(obs.originatingCentre());
val = obs.valueByOccurrence(index_, descriptor_);
MagLog::dev() << "BufrMultiValueAccessor-Descriptor--->" << descriptor_ << " INDEX--->" << index_
<< " Value--->" << val << endl;
// FMagLog::dev() << "BufrMultiValueAccessor-Descriptor--->" << descriptor_ << " INDEX--->" << index_
// F << " Value--->" << val << endl;
}
virtual void print() {}

Expand Down Expand Up @@ -418,14 +418,14 @@ class BufrThicknessAccessor : public BufrAccessor {
val = 0;
}
else {
// MagLog::dev()<< " look for --->" << table.ident(altitude_) << " at " << decoder.getLevel();
// FMagLog::dev()<< " look for --->" << table.ident(altitude_) << " at " << decoder.getLevel();
// upper-air data
if (type == 5 || type == 4)
val = 0;
else // Multi-level data {
val = abs(obs.valueByPressureLevel(decoder.level_, table.ident(keyword_)) -
obs.valueByPressureLevel(decoder.level2_, table.ident(keyword_)));
// MagLog::dev()<< " : get --->" << val << endl;
// FMagLog::dev()<< " : get --->" << val << endl;
}
}

Expand Down Expand Up @@ -623,7 +623,7 @@ void ObsDecoder::getInfo(const std::set<string>& tokens, multimap<string, string
}

for (std::set<string>::const_iterator no = noduplicate.begin(); no != noduplicate.end(); ++no) {
MagLog::debug() << " ObsDecoderToken: " << *token << " -> " << *no << "\n";
// FMagLog::debug() << " ObsDecoderToken: " << *token << " -> " << *no << "\n";

// here we add it to the list, only if it is the obs_types_list!
if (findInTypes(*no))
Expand Down Expand Up @@ -691,7 +691,7 @@ void ObsDecoder::customisedPoints(const Transformation& transformation, const st
ostringstream title;
title << "[ type = " << obs.messageType() << " , subtype = " << obs.messageSubtype() << "]";
title_ = title.str();
MagLog::debug() << " ObsTitle: " << title_ << "\n";
// FMagLog::debug() << " ObsTitle: " << title_ << "\n";
first = false;
}

Expand Down
36 changes: 17 additions & 19 deletions src/visualisers/Filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ bool MinMaxFilter::Process() {

// Initialize input buffer
if (this->InitBuffer() == false) {
MagLog::debug() << " InitBuffer Error"
<< "\n";
// FMagLog::debug() << " InitBuffer Error" << "\n";
return false;
}

Expand Down Expand Up @@ -177,7 +176,7 @@ bool MinMaxFilter::Process() {

if (found) // minimum found
{
// MagLog::debug() << "Min " << lin+fcr+1 << " " << col+fcc+1 << " " << val << "\n";
// FMagLog::debug() << "Min " << lin+fcr+1 << " " << col+fcc+1 << " " << val << "\n";
lo = lo + 1;
push_back(UserPoint(this->matrix_.column(lin + fcr, col + fcc),
this->matrix_.row(lin + fcr, col + fcc), val));
Expand Down Expand Up @@ -205,7 +204,7 @@ bool MinMaxFilter::Process() {

if (found) // minimum found
{
// MagLog::debug() << "Max " << lin+fcr+1 << " " << col+fcc+1 << " " << val << "\n";
// FMagLog::debug() << "Max " << lin+fcr+1 << " " << col+fcc+1 << " " << val << "\n";
hi = hi + 1;
push_back(UserPoint(this->matrix_.column(lin + fcr, col + fcc),
this->matrix_.row(lin + fcr, col + fcc), val));
Expand All @@ -219,8 +218,8 @@ bool MinMaxFilter::Process() {
break;
}

MagLog::debug() << "TOTAL POINTS LOW = " << lo << "\n"
<< "TOTAL POINTS HI = " << hi << "\n";
// FMagLog::debug() << "TOTAL POINTS LOW = " << lo << "\n"
// F << "TOTAL POINTS HI = " << hi << "\n";
return true;
}

Expand All @@ -242,8 +241,7 @@ void MinMaxFilter::test_build_data() {

// Initialize input buffer
if (this->InitBuffer() == false) {
MagLog::debug() << " InitBuffer Error"
<< "\n";
// FMagLog::debug() << " InitBuffer Error" << "\n";
return;
}

Expand All @@ -252,11 +250,11 @@ void MinMaxFilter::test_build_data() {
// Processing
for (lin = 0; lin <= this->matrix_.rows() - this->nrows_; lin++) {
printf("\n");
for (i = 0; i < this->nrows_; i++) {
for (j = 0; j < this->matrix_.columns(); j++)
MagLog::debug() << this->fbuf_[i][j] << " ";
printf("\n");
}
// Ffor (i = 0; i < this->nrows_; i++) {
// F for (j = 0; j < this->matrix_.columns(); j++)
// FMagLog::debug() << this->fbuf_[i][j] << " ";
// F printf("\n");
// F}

for (col = 0; col <= this->matrix_.columns() - this->ncols_; col++) {
// check min value
Expand All @@ -278,8 +276,8 @@ void MinMaxFilter::test_build_data() {

if (found) // minimum found
{
MagLog::debug() << "\n"
<< "Min " << lin + fcr + 1 << " " << col + fcc + 1 << " " << val << "\n";
// FMagLog::debug() << "\n"
// F << "Min " << lin + fcr + 1 << " " << col + fcc + 1 << " " << val << "\n";
lo = lo + 1;
}
}
Expand All @@ -303,8 +301,8 @@ void MinMaxFilter::test_build_data() {

if (found) // minimum found
{
MagLog::debug() << "\n"
<< "Max " << lin + fcr + 1 << " " << col + fcc + 1 << " " << val << "\n";
// FMagLog::debug() << "\n"
// F << "Max " << lin + fcr + 1 << " " << col + fcc + 1 << " " << val << "\n";
hi = hi + 1;
}
}
Expand All @@ -314,8 +312,8 @@ void MinMaxFilter::test_build_data() {
break;
}

MagLog::debug() << "TOTAL POINTS LOW=" << lo << "\n";
MagLog::debug() << "TOTAL POINTS HI =" << hi << "\n";
// FMagLog::debug() << "TOTAL POINTS LOW=" << lo << "\n";
// FMagLog::debug() << "TOTAL POINTS HI =" << hi << "\n";

printf("\n\nEND TEST\n");
}
Loading

0 comments on commit 0e2c55e

Please sign in to comment.