Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions to get working and user directory. #156

Open
frankenjoe opened this issue Jul 19, 2024 · 5 comments
Open

Add functions to get working and user directory. #156

frankenjoe opened this issue Jul 19, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@frankenjoe
Copy link
Collaborator

In #155 we implement a function that returns the directory of the current script. It might be a good fit to also add a function that returns the current working directory (e.g. working_dir()) and user directory (e.g. user_dir()).

@frankenjoe frankenjoe added the enhancement New feature or request label Jul 19, 2024
@hagenw
Copy link
Member

hagenw commented Jul 19, 2024

The current working dir is returned by os.getcwd(), or are you referring to a different directory?

@frankenjoe
Copy link
Collaborator Author

No, audeer.working_dir() would return os.getcwd() and audeer.user_dir() return audeer.path("~"). Then we provide functions for the three special directories. But maybe that is not really needed.

@hagenw
Copy link
Member

hagenw commented Jul 19, 2024

It is not really needed as there exist alternatives that involve only a single function call (as was not the case with audeer.script_dir()).
But I see the point for providing these functions for symmetric reasons ;)

audeer.user_dir() has the problem, that it is not completely obvious what is meant. As I first thought you are referring to the directory in which the user was when starting a script. So maybe audeer.home_dir() would be a better choice?

@frankenjoe
Copy link
Collaborator Author

Right, if we decided to add these functions then audeer.home_dir() would be a better fit.

@frankenjoe
Copy link
Collaborator Author

which the user was when starting a script.

Mhh, if it's possible to get this location, this would also be a nice function to have :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants