Skip to content

Allow users to provide table names as pathlib.Path objects - #295

Merged
gmloose merged 1 commit into
casacore:masterfrom
rtobar:tablename-as-path
Aug 19, 2026
Merged

Allow users to provide table names as pathlib.Path objects#295
gmloose merged 1 commit into
casacore:masterfrom
rtobar:tablename-as-path

Conversation

@rtobar

@rtobar rtobar commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

In a few codebases we use pathlib.Path objects for denoting paths in the filesystem. However python-casacore stringly requires a str for its tablename arguments throughout. This PR adds support for providing table names as pathlib.Path objects.

@gmloose gmloose left a comment

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.

I have some remarks. See above.

Comment thread casacore/tables/table.py
Comment thread casacore/tables/tablehelper.py Outdated
Comment thread tests/test_table.py
@rtobar

rtobar commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

@gmloose thanks for the review! Please let me know how you think I should proceed with each individual note, hopefully the rationale for each of them is clearer now.

@gmloose

gmloose commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

@gmloose thanks for the review! Please let me know how you think I should proceed with each individual note, hopefully the rationale for each of them is clearer now.

If you could follow up on the suggestion here, I think you're good to go. You can ignore the comments about the local import and the use of a context manager in the test.

@rtobar
rtobar force-pushed the tablename-as-path branch from 0e8c67d to 9d999c1 Compare August 19, 2026 10:48

@rtobar rtobar left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks again @gmloose for the review!

Comment thread casacore/tables/tablehelper.py Outdated

@gmloose gmloose left a comment

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.

Just one more thing. I spotted a typo (see comment).

Comment thread tests/test_table.py Outdated
Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
@rtobar
rtobar force-pushed the tablename-as-path branch from 9d999c1 to e38c951 Compare August 19, 2026 14:40
@gmloose
gmloose merged commit 1f6cd46 into casacore:master Aug 19, 2026
2 checks passed
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