Skip to content

Commit

Permalink
remove hardcoded paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jusack committed Feb 16, 2024
1 parent 6cec732 commit 88c3489
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/DatasetStore/SFDatabase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ function findSFFiles(d::BrukerDatasetStore)
end
end
end
BrukerMDFSFs = readdir("/opt/data/MDF_SFs/")
for BrukerMDFSF in BrukerMDFSFs
prefix, ext = splitext(BrukerMDFSF)
if ext == ".mdf"
push!(bfiles,joinpath("/opt/data/MDF_SFs/",BrukerMDFSF))
if isdir("/opt/data/MDF_SFs/")
BrukerMDFSFs = readdir("/opt/data/MDF_SFs/")
for BrukerMDFSF in BrukerMDFSFs
prefix, ext = splitext(BrukerMDFSF)
if ext == ".mdf"
push!(bfiles,joinpath("/opt/data/MDF_SFs/",BrukerMDFSF))

Check warning on line 24 in src/DatasetStore/SFDatabase.jl

View check run for this annotation

Codecov / codecov/patch

src/DatasetStore/SFDatabase.jl#L19-L24

Added lines #L19 - L24 were not covered by tests
end
end
end
return bfiles
Expand Down Expand Up @@ -129,9 +131,9 @@ function generateSFDatabase(d::MDFDatasetStore)
end

# HAAACKKK
function generateSFDatabase(d::BrukerDatasetStore)
oldfile = "/opt/data/SF_DatabaseOld.csv"
newfile = "/opt/data/SF_Database.csv"
function generateSFDatabase(d::BrukerDatasetStore; dbpath="/opt/data")
oldfile = joinpath(dbpath, "SF_DatabaseOld.csv")
newfile = joinpath(dbpath, "SF_Database.csv")

Check warning on line 136 in src/DatasetStore/SFDatabase.jl

View check run for this annotation

Codecov / codecov/patch

src/DatasetStore/SFDatabase.jl#L134-L136

Added lines #L134 - L136 were not covered by tests
generateSFDatabase_(d, oldfile, newfile)
end

Expand All @@ -148,11 +150,12 @@ function generateSFDatabase_(d::DatasetStore, oldfile, newfile)
generateSFDatabase(d, newfile)
end

function loadSFDatabase(d::BrukerDatasetStore)
if isfile("/opt/data/SF_Database.csv")
A = readdlm("/opt/data/SF_Database.csv",',')
function loadSFDatabase(d::BrukerDatasetStore; dbpath="/opt/data")
filepath = joinpath(dbpath, "SF_Database.csv")
if isfile(filepath)
A = readdlm(filepath,',')

Check warning on line 156 in src/DatasetStore/SFDatabase.jl

View check run for this annotation

Codecov / codecov/patch

src/DatasetStore/SFDatabase.jl#L153-L156

Added lines #L153 - L156 were not covered by tests
if size(A,2) < 16
A = readdlm("/opt/data/SF_Database.csv",'\t')
A = readdlm(filepath,'\t')

Check warning on line 158 in src/DatasetStore/SFDatabase.jl

View check run for this annotation

Codecov / codecov/patch

src/DatasetStore/SFDatabase.jl#L158

Added line #L158 was not covered by tests
end
return A
else
Expand Down

0 comments on commit 88c3489

Please sign in to comment.