Skip to content

feat: Add retries to download_file. - #5382

Draft
prmukherj wants to merge 8 commits into
mainfrom
feat/add_retried_to_download_file
Draft

feat: Add retries to download_file.#5382
prmukherj wants to merge 8 commits into
mainfrom
feat/add_retried_to_download_file

Conversation

@prmukherj

Copy link
Copy Markdown
Collaborator

Context

Some arguments like max_retries were missing from download_file method in examples.

Change Summary

Instead of having a local implementation, just use the implementation already in ansys-tools-common by flattening out paths wherever required to match PyFluent's style.

@github-actions github-actions Bot added maintenance General maintenance of the repo (libraries, cicd, etc) dependencies Related to dependencies new feature labels Sep 9, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@prmukherj
prmukherj marked this pull request as ready for review September 9, 2026 12:20
@prmukherj prmukherj linked an issue Sep 9, 2026 that may be closed by this pull request
Comment thread tests/test_session.py Outdated
Comment on lines +271 to +276
result = examples.download_file(
"elbow.cas.h5",
"pyfluent/mixing_elbow",
save_path=str(tmp_path),
return_without_path=True,
)

@seanpearsonuk seanpearsonuk Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That's an awkward API because the return_without_path argument changes the semantics of the return value. It makes sense to introduce a new method that returns the downloaded file as a pathlib.Path, e.g. download_file_path(), and deprecate return_without_path on the existing download_file() method. This would give us a cleaner API while preserving backwards compatibility for existing callers.

@prmukherj @mkundu1
@RobPasMue @AlejandroFernandezLuces

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yes, makes sense @seanpearsonuk. This is a pyfluent specific implementation. Will update it. Thank you

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ok, thanks, explains why I didn't remember it from the recent PR.

@prmukherj
prmukherj marked this pull request as draft September 10, 2026 06:57
@github-actions github-actions Bot added the documentation Documentation related (improving, adding, etc) label Sep 10, 2026
@github-actions github-actions Bot added the CI/CD label Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD dependencies Related to dependencies documentation Documentation related (improving, adding, etc) maintenance General maintenance of the repo (libraries, cicd, etc) new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add retries to download file

3 participants