Use ansys.tools.common for example data download - #990
Conversation
- Use ansys.tools.common.example_download for downloading data from the `ansys/example-data` repository instead of directly downloading with urllib. - The download is still wrapped in our own function to keep the enum-based interface for the example data.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #990 +/- ##
==========================================
- Coverage 93.90% 93.89% -0.01%
==========================================
Files 110 110
Lines 5902 5898 -4
Branches 332 332
==========================================
- Hits 5542 5538 -4
Misses 354 354
Partials 6 6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| if TYPE_CHECKING: # pragma: no cover | ||
| from ansys.acp.core import Model | ||
|
|
||
| _EXAMPLE_REPO = "https://github.com/ansys/example-data/raw/main/pyacp/" |
There was a problem hiding this comment.
The switch between github and a local file URL was handy to implement new examples and for testing purposes. Is that still easy possible?
There was a problem hiding this comment.
Good point. It's not possible as-is AFAICT, but we can implement it either here or within ansys-tools-common.
There was a problem hiding this comment.
The same is used in PyDPF-Composites and I assume other would benefit as well. Do you mind to implement it in the ansys tool?
ansys/example-datarepository instead of directly downloading with urllib.Resolves #968