diff --git a/.github/workflows/clang_format_check.yaml b/.github/workflows/clang_format_check.yaml index b49de1b7d..ee2309c17 100644 --- a/.github/workflows/clang_format_check.yaml +++ b/.github/workflows/clang_format_check.yaml @@ -4,7 +4,7 @@ on: [pull_request, push] jobs: build: name: clang-format-check - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest # Run on external PRs, but not internal PRs as they'll be run by the push if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository diff --git a/.github/workflows/coverage_test.yaml b/.github/workflows/coverage_test.yaml index 5f8ea888f..ea97f93c9 100644 --- a/.github/workflows/coverage_test.yaml +++ b/.github/workflows/coverage_test.yaml @@ -8,7 +8,7 @@ env: jobs: build: name: coverage-test - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest # Run on external PRs, but not internal PRs as they'll be run by the push if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository diff --git a/.github/workflows/docstring_check.yaml b/.github/workflows/docstring_check.yaml index 12cc05981..3290ba06b 100644 --- a/.github/workflows/docstring_check.yaml +++ b/.github/workflows/docstring_check.yaml @@ -4,18 +4,25 @@ on: [pull_request, push] jobs: build: name: docstring-check - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest # Run on external PRs, but not internal PRs as they'll be run by the push if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository steps: - - name: Fetch repository + - name: Checkout repository uses: actions/checkout@v3 with: - submodules: recursive - - name: Install packages - run: sudo apt-get update && sudo apt-get install build-essential libhdf5-dev python3-venv libclang1-9 + submodules: 'true' + + - name: Setup python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install packages on Linux + run: sudo apt-get update && sudo apt-get install build-essential libhdf5-dev + - name: Check docstrings run: | export LIBCLANG_PATH=/usr/lib/x86_64-linux-gnu/libclang-9.so.1 diff --git a/.github/workflows/publish-sdist-wheels.yml b/.github/workflows/publish-sdist-wheels.yml index 9271fc619..5114cac2f 100644 --- a/.github/workflows/publish-sdist-wheels.yml +++ b/.github/workflows/publish-sdist-wheels.yml @@ -17,7 +17,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, macos-11, windows-2022] + os: [ubuntu-latest, macos-11, windows-2022] steps: - uses: actions/checkout@v3 diff --git a/src/readers/morphologySWC.cpp b/src/readers/morphologySWC.cpp index 9d8d0e434..d4a79e3cf 100644 --- a/src/readers/morphologySWC.cpp +++ b/src/readers/morphologySWC.cpp @@ -1,6 +1,8 @@ #include "morphologySWC.h" #include // uint32_t +#include // sscanf +#include // std::locale #include // std::shared_ptr #include // std::stringstream #include // std::string @@ -29,6 +31,9 @@ morphio::readers::Sample readSample(const char* line, unsigned int lineNumber_) morphio::floatType radius = -1.; int int_type = -1; morphio::readers::Sample sample; + + // Set local to classic in order to ensure that dots are recognized as decimal points by sscanf + std::locale prev_locale = std::locale::global(std::locale::classic()); sample.valid = sscanf(line, format, &sample.id, @@ -39,6 +44,9 @@ morphio::readers::Sample readSample(const char* line, unsigned int lineNumber_) &radius, &sample.parentId) == 7; + // Restore locale + std::locale::global(prev_locale); + sample.type = static_cast(int_type); sample.diameter = radius * 2; // The point array stores diameters. sample.lineNumber = lineNumber_;