Skip to content

Commit

Permalink
Merge pull request #1117 from NREL-Sienna/gks/ignore_extraneous
Browse files Browse the repository at this point in the history
Ignore known-benign extraneous files in simulation results
  • Loading branch information
jd-lara authored Jun 24, 2024
2 parents accd5b3 + 95a77ac commit d2db0bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/definitions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ const KNOWN_SIMULATION_PATHS = [
"simulation_files",
"simulation_partitions",
]
"If the name of an extraneous file that appears in simulation results matches one of these regexes, it is safe to ignore"
const IGNORABLE_FILES = [
r"^\.DS_Store$",
r"^\.Trashes$",
r"^\.Trash-.*$",
r"^\.nfs.*$",
r"^[Dd]esktop.ini$",
]
const RESULTS_DIR = "results"

# Enums
Expand Down
1 change: 1 addition & 0 deletions src/simulation/simulation_results.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
function check_folder_integrity(folder::String)
folder_files = readdir(folder)
alien_files = setdiff(folder_files, KNOWN_SIMULATION_PATHS)
alien_files = filter(x -> !any(occursin.(IGNORABLE_FILES, x)), alien_files)
if isempty(alien_files)
return true
else
Expand Down

0 comments on commit d2db0bf

Please sign in to comment.