Skip to content

Commit

Permalink
hotfix(paths) add abs paths of database, phinp and model wd to yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
p-ortega committed Aug 12, 2024
1 parent 461fcf2 commit cb07c7d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/mf6rtm/mf6rtm.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,12 @@ def set_wd(self, wd):
"""
Sets the working directory for the MF6RTM model.
"""
# get absolute path of the working directory
wd = Path(os.path.abspath(wd))
# joint current directory with wd, check if exist, create if not
self.wd = Path(wd)
if not self.wd.exists():
self.wd.mkdir(parents=True, exist_ok=True)
if not wd.exists():
wd.mkdir(parents=True, exist_ok=True)
self.wd = wd

def set_database(self, database):
"""
Expand All @@ -229,6 +231,8 @@ def set_database(self, database):
None
"""
assert os.path.exists(database), f'{database} not found'
# get absolute path of the database
database = os.path.abspath(database)
self.database = database

def set_postfix(self, postfix):
Expand Down Expand Up @@ -823,7 +827,6 @@ def solve(wd, reactive=True):
if not reactive:
mf6rtm._set_reactive(reactive)
mf6rtm._solve()
print('done')

def initialize_interfaces(wd):
'''Function to initialize the interfaces for modflowapi and phreeqcrm and returns the mf6rtm object
Expand Down

0 comments on commit cb07c7d

Please sign in to comment.