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

Make the pbp-meta-gen Windows compadible. #31

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

spacetimeengineer
Copy link
Contributor

I added a conditional to make the strings work :

import os

if os.name == "nt":
wav_path = Path(parsed_uri.path[1:])
else:
wav_path = Path(parsed_uri.path)

I was able to produce metadata files on Windows with this build.

@carueda carueda requested a review from danellecline August 28, 2024 19:11
…I wrong.

Assuming the URI is of the form file:/// when called with pbp-meta-gen then we need the 3 instead of the 1. This was a mistake on my part on my most recent pull request. This would correct it.
@spacetimeengineer
Copy link
Contributor Author

FYI I just had to post a second commit because I needed to change the [1:] to a [3:]. Just now. This was because I made a mistake testing ; my URI only had one slash when it worked :/ This fixes that issue and will make it more consistent.

@danellecline
Copy link
Collaborator

@spacetimeengineer
Thanks for the contribution! I'm glad you could make this work on Windows with this simple addition.

Can you please post your command line here? That would be helpful for documentation and reproducibility. Many thanks.

@spacetimeengineer
Copy link
Contributor Author

@spacetimeengineer Thanks for the contribution! I'm glad you could make this work on Windows with this simple addition.

Can you please post your command line here? That would be helpful for documentation and reproducibility. Many thanks.

Sure!

(mbari-pbp) C:\Users\michael.ryan>pbp-meta-gen --recorder SOUNDTRAP --json-base-dir C:\Users\michael.ryan\Desktop\SOUNDTRAP\PYPAM\JSON --output-dir C:\Users\michael.ryan\Desktop\SOUNDTRAP\PYPAM --uri file:\\\C:\Users\michael.ryan\Desktop\SOUNDTRAP  --start 20220520 --end 20220521 --prefix 6550
C:\Users\michael.ryan\Desktop\SOUNDTRAP
2024-08-28T15:15:03.629974-0400 INFO Searching in file:\\\C:\Users\michael.ryan\Desktop\SOUNDTRAP/*.wav for wav files that match the prefixes ['6550']* ...
Searching : 100% (7 of 7) |##########################################################################################################| Elapsed Time: 0:00:00 Time:  0:00:00
2024-08-28T15:15:03.629974-0400 INFO Found 7 files to process that cover the expanded period 2022-05-21 23:53:23 - 2022-05-22 00:00:00
2024-08-28T15:15:03.629974-0400 INFO Creating dataframe from 7 files spanning 2022-05-20 23:53:23 to 2022-05-21 23:53:23...
2024-08-28T15:15:03.629974-0400 INFO Creating metadata for day 2022-05-20 00:00:00 from 1 files...
2024-08-28T15:15:03.629974-0400 INFO Found 1 files for day 2022-05-20 00:00:00, between 2022-05-20 23:53:23 and 2022-05-21 03:53:23
2024-08-28T15:15:03.629974-0400 INFO Using file start times as is, setting jitter to 0 and calculating end times.
2024-08-28T15:15:03.645591-0400 INFO Wrote C:\Users\michael.ryan\Desktop\SOUNDTRAP\PYPAM\JSON\2022/20220520.json
2024-08-28T15:15:03.645591-0400 INFO Done correcting metadata for 2022-05-20 00:00:00. Saved to C:/Users/michael.ryan/Desktop/SOUNDTRAP/PYPAM/JSON
2024-08-28T15:15:03.645591-0400 INFO Creating metadata for day 2022-05-21 00:00:00 from 7 files...
2024-08-28T15:15:03.645591-0400 INFO Found 7 files for day 2022-05-21 00:00:00, between 2022-05-20 23:53:23 and 2022-05-22 03:53:23
2024-08-28T15:15:03.645591-0400 INFO Using file start times as is, setting jitter to 0 and calculating end times.
2024-08-28T15:15:03.661214-0400 INFO Wrote C:\Users\michael.ryan\Desktop\SOUNDTRAP\PYPAM\JSON\2022/20220521.json
2024-08-28T15:15:03.661214-0400 INFO Done correcting metadata for 2022-05-21 00:00:00. Saved to C:/Users/michael.ryan/Desktop/SOUNDTRAP/PYPAM/JSON

@danellecline danellecline merged commit 1016c1f into mbari-org:main Aug 28, 2024
1 check passed
@spacetimeengineer spacetimeengineer deleted the windows_compadible branch August 28, 2024 21:02
@spacetimeengineer spacetimeengineer restored the windows_compadible branch August 29, 2024 01:16
@spacetimeengineer spacetimeengineer deleted the windows_compadible branch August 29, 2024 01:18
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.

2 participants