Skip to content

Commit c6cf48e

Browse files
authored
bug fix (#19)
* bug fix * bug fix * Update DLMReader.jl
1 parent 10d2a5e commit c6cf48e

File tree

4 files changed

+29
-32
lines changed

4 files changed

+29
-32
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
name: CI
22
on:
33
pull_request:
4-
branches:
5-
- main
64
push:
7-
branches:
8-
- master
9-
tags: '*'
10-
release:
11-
workflow_dispatch:
5+
branches: [main]
6+
tags: ['*']
127
jobs:
138
test:
149
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
@@ -17,9 +12,8 @@ jobs:
1712
fail-fast: false
1813
matrix:
1914
version:
15+
- '1.10'
2016
- '1' # automatically expands to the latest stable 1.x release of Julia
21-
- '1.6'
22-
- 'nightly'
2317
os:
2418
- ubuntu-latest
2519
arch:
@@ -28,37 +22,37 @@ jobs:
2822
- os: windows-latest
2923
version: '1'
3024
arch: x64
25+
- os: macos-latest
26+
version: '1'
27+
arch: aarch64
28+
- os: ubuntu-latest
29+
version: 'nightly'
30+
arch: x64
31+
allow_failure: true
3132
steps:
32-
- uses: actions/checkout@v2
33-
- uses: julia-actions/setup-julia@v1
33+
- uses: actions/checkout@v5
34+
- uses: julia-actions/setup-julia@v2
3435
with:
3536
version: ${{ matrix.version }}
3637
arch: ${{ matrix.arch }}
37-
- uses: actions/cache@v1
38-
env:
39-
cache-name: cache-artifacts
40-
with:
41-
path: ~/.julia/artifacts
42-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
43-
restore-keys: |
44-
${{ runner.os }}-test-${{ env.cache-name }}-
45-
${{ runner.os }}-test-
46-
${{ runner.os }}-
38+
- uses: julia-actions/cache@v2
39+
- uses: julia-actions/julia-buildpkg@v1
4740
- uses: julia-actions/julia-runtest@v1
4841
env:
49-
JULIA_NUM_THREADS: 4
42+
JULIA_NUM_THREADS: 4,1
5043
- uses: julia-actions/julia-processcoverage@v1
51-
- uses: codecov/codecov-action@v1
44+
- uses: codecov/codecov-action@v5
5245
with:
53-
file: lcov.info
46+
files: lcov.info
47+
token: ${{ secrets.CODECOV_TOKEN }}
5448
docs:
5549
name: Documentation
5650
runs-on: ubuntu-latest
5751
steps:
58-
- uses: actions/checkout@v2
59-
- uses: julia-actions/setup-julia@v1
60-
with:
61-
version: '1'
52+
- uses: actions/checkout@v5
53+
- uses: julia-actions/setup-julia@v2
54+
- uses: julia-actions/julia-buildpkg@latest
55+
- uses: julia-actions/julia-docdeploy@latest
6256

6357
- run: |
6458
julia --project=docs/ -e '

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
name = "DLMReader"
22
uuid = "e1d33f9a-7203-49d2-8e1a-e3c4f85197b8"
33
authors = ["sl-solution <[email protected]> and contributors"]
4-
version = "0.4.14"
4+
version = "0.4.15"
55

66
[deps]
77
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
88
InMemoryDatasets = "5c01b14b-ab03-46ff-b164-14c663efdd9f"
99
InlineStrings = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48"
10+
Parsers = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
1011
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1112
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
1213

1314
[compat]
1415
InMemoryDatasets = "0.3, 0.4, 0.5, 0.6, 0.7"
1516
InlineStrings = "1.0"
1617
julia = "1.6"
18+
Parsers = "2.5"
1719
Reexport = "0.1, 0.2, 1"
1820

1921
[extras]

src/DLMReader.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module DLMReader
33
using InMemoryDatasets
44
using UUIDs
55
using Reexport
6+
using Parsers
67
@reexport using Dates, InlineStrings
78

89
export
@@ -25,7 +26,7 @@ export
2526
# see https://github.com/sl-solution/DLMReader.jl/issues/5
2627
if Base.Sys.iswindows()
2728
function typeparser(::Type{T}, x::Vector{UInt8}, lo::Int, hi::Int) where T <: Real
28-
val = InlineStrings.Parsers.xparse(T, x, lo, hi)
29+
val = Parsers.xparse(T, x, lo, hi)
2930
if val.code == 33
3031
return true, val.val
3132
else

src/util.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ function parse_eachrow(problems::Vector{Bool}, ::Type{T}, x::Vector, buffer::Lin
853853
idx[i,j] = (new_lo, new_hi)
854854
end
855855
if char_buff !== nothing
856-
charbuff = char_buff[Threads.threadid()]
856+
charbuff = char_buff[Threads.threadid() % Threads.nthreads() + 1]
857857
else
858858
charbuff = nothing
859859
end
@@ -876,7 +876,7 @@ function parse_eachrow(problems::Vector{Bool}, ::Type{T}, x::Vector, buffer::Lin
876876
idx[i,j] = (new_lo, new_hi)
877877
end
878878
if char_buff !== nothing
879-
charbuff = char_buff[Threads.threadid()]
879+
charbuff = char_buff[1]
880880
else
881881
charbuff = nothing
882882
end

0 commit comments

Comments
 (0)