Skip to content

Commit be64dc3

Browse files
committed
remove file operations module
1 parent 0efe0dc commit be64dc3

File tree

3 files changed

+5
-56
lines changed

3 files changed

+5
-56
lines changed

src/Trajectory.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function Trajectory(
3333
format::String = "",
3434
chemfiles = false,
3535
)
36-
if !chemfiles && (format == "dcd" || FileOperations.file_extension(filename) == "dcd")
36+
if !chemfiles && (format == "dcd" || split(filename, '.')[end] == "dcd")
3737
trajectory = NamdDCD(filename, solute, solvent)
3838
elseif !chemfiles && format == "PDBTraj"
3939
trajectory = PDBTraj(filename, solute, solvent)

src/io.jl

-51
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,3 @@
1-
2-
module FileOperations
3-
4-
#
5-
# Function that removes the extension of a file name
6-
#
7-
remove_extension(file::String) = file[1:findlast(==('.'), file)-1]
8-
9-
#
10-
# Function that determines the basename of a file, removing the path and the extension
11-
#
12-
clearname(filename::String) = remove_extension(basename(filename))
13-
14-
#
15-
# Function that return only the extension of the file
16-
#
17-
file_extension(file::String) = file[findlast(==('.'), file)+1:end]
18-
19-
#
20-
# Function that determines if a character is empty
21-
#
22-
empty_char(c::Char) = in(c, (Char(9), Char(32)))
23-
24-
#
25-
# Function that checks if a line is a comment line or if it is empty
26-
#
27-
function commentary(s::String)
28-
i = findfirst(c -> !(empty_char(c)), s)
29-
return isnothing(i) || s[i] == '#'
30-
end
31-
32-
end # module
33-
34-
35-
"""
36-
37-
$(INTERNAL)
38-
39-
$(TYPEDEF)
40-
41-
Structure to contain the names of the output files.
42-
43-
$(TYPEDFIELDS)
44-
45-
"""
46-
@kwdef mutable struct OutputFiles
47-
output::String
48-
solute_atoms::String
49-
solvent_atoms::String
50-
end
51-
521
"""
532
543
$(INTERNAL)

src/legacy/write_results.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ function write(
3131

3232
# Names of output files containing atomic contibutions
3333
atom_contributions_solvent = normpath(
34-
FileOperations.remove_extension(filename) *
34+
filename[1:findlast(==('.'), filename)-1] *
3535
"-ATOM_CONTRIBUTIONS_SOLVENT." *
36-
FileOperations.file_extension(filename)
36+
split(filename, '.')[end]
3737
)
3838
atom_contributions_solute = normpath(
39-
FileOperations.remove_extension(filename) *
39+
filename[1:findlast(==('.'), filename)-1] *
4040
"-ATOM_CONTRIBUTIONS_SOLUTE." *
41-
FileOperations.file_extension(filename)
41+
split(filename, '.')[end]
4242
)
4343

4444
#

0 commit comments

Comments
 (0)