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

WIP - Python - Create a file path and directory resolver & migrate away from hard coded paths #908

Closed
wants to merge 15 commits into from

Conversation

jaredb7
Copy link

@jaredb7 jaredb7 commented May 15, 2023

Created a file path and directory resolver that can be called with a file name or directory and returns a path relative to a home path, which is still currently fixed to the use executing the scripts but the idea that now this can be easily changed.
This resolver is practically identical to the one created in #901 to support the Web UI

Updated the 4 only python scripts to use this resolver when looking for the bird.db path, models, labels.txt etc etc
All scripts have been tested and work fine, but comments/suggestions welcome.

Included test_filepath_resolver.py which runs a simple list of tests against the new get_file_path and get_directory to ensure they return what we expect
The script should return nothing if all was ok

Relies upon #901 for config/filepath_map.json

Created a file path and directory resolver that can be called with a filename or directory and returns a path relative to a home path (which is still currently fixed but can be easily changed)

Updated the 4 only python scripts to use this resolver when looking for the bird.db path, models, labels.txt etc etc

Included test_filepath_resolver.py which runs a simple list of tests against the new get_file_path and get_directory to ensure they return what we expect
croisez and others added 6 commits May 20, 2023 09:49
To avoid having to update file or directory paths in 3 script locations (PHP Common, Shell Common and Python File path resolver)

A JSON file that describes folder and file locations will be referenced by all 3 systems, allowing  them to generate paths from one central location, With the hope that files can be then moved around, the file updated and all 3 languages will up to date without any other work.
Added possibility in Spectrogram view to activate frequency shifting
@ehpersonal38 ehpersonal38 changed the base branch from main to PR-development May 22, 2023 16:13
@jaredb7 jaredb7 changed the title Python - Create a file path and directory resolver & migrate hard coded paths in scripts WIP - Python - Create a file path and directory resolver & migrate away from hard coded paths May 24, 2023
@jaredb7 jaredb7 closed this May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants