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

Partial pathlib port #233

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Partial pathlib port #233

wants to merge 4 commits into from

Conversation

fsimonis
Copy link
Member

@fsimonis fsimonis commented Mar 6, 2025

Main changes of this PR

This PR ports ASTE python script to using pathlib.Path.

The creative coding styles of precice-aste-partition and precice-aste-evaluate make them a challenge to port.

Author's checklist

  • I used the pre-commit hook and used pre-commit run --all to apply all available hooks.
  • I added a test to cover the proposed changes in our test suite.
  • I updated the documentation in docs/README.md.
  • I added a changelog entry in ./changelog-entries/ (create if necessary).
  • I updated potential breaking changes in the tutorial precice/tutorials/aste-turbine.

@davidscn
Copy link
Member

davidscn commented Mar 6, 2025

Could you say something about the motivation to use pathlib over os.path?

@fsimonis
Copy link
Member Author

fsimonis commented Mar 6, 2025

Could you say something about the motivation to use pathlib over os.path?

Best to take a look at PEP 428. In general:

  • Object-oriented interface instead of relying on str
  • Support for chaining and easier queries
  • Doesn't mix with buildins by default. Which can easily result in bugs when using str

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