Skip to content

default_params.yaml Directory Issue #3

Description

@kglidic
  • jtow version: 0.1.3
  • Python version: 3.8.13
  • Operating System: Windows

Description

When running jtow, if one does not provide a parameter file, the code will automatically refer to this default parameter file. However, the directories to the data that the yaml file is pointing to users do not have access to it. Maybe there is a way to download default data from Zenodo and have it point to a directory it will make for the user.

What I Did

from jtow import jtow
jtow_obj = jtow.jw() #If no parameter file given

---------------------------------------------------------------------------
PermissionError                           Traceback (most recent call last)
Input In [9], in <cell line: 1>()
----> 1 jtow_obj = jtow.jw()

File ~/Software/jtow/jtow/jtow.py:109, in jw.__init__(self, paramFile, directParam)
    106     if oneKey not in self.param:
    107         self.param[oneKey] = defaultParams[oneKey]
--> 109 self.set_up_dirs()
    110 self.get_files()
    112 self.make_descrip()

File ~/Software/jtow/jtow/jtow.py:152, in jw.set_up_dirs(self)
    150 for oneDir in [self.output_dir,self.diagnostic_dir]:
    151     if os.path.exists(oneDir) == False:
--> 152         os.makedirs(oneDir)

File ~/miniconda3/envs/JWST-1.5.2/lib/python3.8/os.py:213, in makedirs(name, mode, exist_ok)
    211 if head and tail and not path.exists(head):
    212     try:
--> 213         makedirs(head, exist_ok=exist_ok)
    214     except FileExistsError:
    215         # Defeats race condition when another thread created the path
    216         pass

File ~/miniconda3/envs/JWST-1.5.2/lib/python3.8/os.py:213, in makedirs(name, mode, exist_ok)
    211 if head and tail and not path.exists(head):
    212     try:
--> 213         makedirs(head, exist_ok=exist_ok)
    214     except FileExistsError:
    215         # Defeats race condition when another thread created the path
    216         pass

    [... skipping similar frames: makedirs at line 213 (3 times)]

File ~/miniconda3/envs/JWST-1.5.2/lib/python3.8/os.py:213, in makedirs(name, mode, exist_ok)
    211 if head and tail and not path.exists(head):
    212     try:
--> 213         makedirs(head, exist_ok=exist_ok)
    214     except FileExistsError:
    215         # Defeats race condition when another thread created the path
    216         pass

File ~/miniconda3/envs/JWST-1.5.2/lib/python3.8/os.py:223, in makedirs(name, mode, exist_ok)
    221         return
    222 try:
--> 223     mkdir(name, mode)
    224 except OSError:
    225     # Cannot rely on checking for EEXIST, since the operating system
    226     # could give priority to other errors like EACCES or EROFS
    227     if not exist_ok or not path.isdir(name):

PermissionError: [Errno 13] Permission denied: '/Users'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions