Skip to content

Conversation

@JanekEbb
Copy link
Contributor

No description provided.

@JanekEbb JanekEbb requested a review from boeddeker December 21, 2023 12:07
@codecov-commenter
Copy link

codecov-commenter commented Dec 21, 2023

Codecov Report

Attention: 51 lines in your changes are missing coverage. Please review.

Comparison is base (3aa0078) 65.52% compared to head (481bc2d) 65.64%.

Files Patch % Lines
paderbox/io/download.py 9.09% 50 Missing ⚠️
paderbox/utils/random_utils.py 92.30% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #96      +/-   ##
==========================================
+ Coverage   65.52%   65.64%   +0.11%     
==========================================
  Files          81       81              
  Lines        5494     5504      +10     
==========================================
+ Hits         3600     3613      +13     
+ Misses       1894     1891       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


@dataclasses.dataclass
class Choice(_Sampler):
events: int = 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choice and choice should have the same default for events.
While other distributions have some kind of natural defaults, I would say, we shouldn't set a default for events.

target_dir = local_file.parent
else:
target_dir = Path(target_dir)
if not target_dir.exists():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this if, just call target_dir.mkdir(parents=True, exist_ok=True)

raise FileExistsError(target_file)
tar.members = []
os.remove(local_file)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason, that you didn't define an else path with a raise? If not, could you raise a warning, when there is an unsupported suffix?

for _ in ex.map(
download_file,
file_list,
[target_dir / Path(f).name.split('?')[0] for f in file_list],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment, why only name is used and why everything behind the ? is ignored?
Alternatively, a doctest could also help to understand the motivation.


>>> [sample_index_to_stft_frame_index(i, 8, 1, fading=None) for i in range(12)]
[0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8]
>>> sample_index_to_stft_frame_index(np.arange(12), 8, 1, fading=None)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a dtype for arange. The Windows test fails, because the default is int32 on windows.

local_file:
exist_ok:
extract:
progress_par:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

progress_bar is no arg


@dataclasses.dataclass
class Choice(_Sampler):
events: int = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not simply events: int? (without a default value)
Then the `post_init``wouldn't be nessesary.

Copy link
Member

@boeddeker boeddeker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When removing the default for events, LGTM.

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.

4 participants