Skip to content

Commit

Permalink
Merge pull request #16 from Nelly-Barret/fix-13
Browse files Browse the repository at this point in the history
system settings in parameters.ini
  • Loading branch information
Nelly-Barret committed Jun 4, 2024
2 parents 2020a1a + d9c7e48 commit cc008fe
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import configparser
import getpass
import os.path
import platform
import sys
import argparse
from datetime import datetime
Expand Down Expand Up @@ -68,8 +70,16 @@
data_filepath = args.data_filepath
config.set("FILES", "data_filepath", data_filepath)

# write more information about the current run in the config
config.add_section("SYSTEM")
config.set("SYSTEM", "python_version", str(sys.version))
config.set("SYSTEM", "execution_date", str(datetime.now()))
config.set("SYSTEM", "platform", platform.platform())
config.set("SYSTEM", "platform_version", platform.version())
config.set("SYSTEM", "user", getpass.getuser())

# save the config file in the current working directory
saved_config_file = os.path.join(working_folder, "command-line.txt")
saved_config_file = os.path.join(working_folder, "parameter.ini")
with open(saved_config_file, 'w') as f:
config.write(f)

Expand Down

0 comments on commit cc008fe

Please sign in to comment.