handley-lab / anesthetic

Nested Sampling post-processing and plotting
https://anesthetic.readthedocs.io
MIT License
57 stars 16 forks source link

Cast `root` to `str` to allow e.g. a `pathlib.Path` object to be used #358

Closed AdamOrmondroyd closed 8 months ago

AdamOrmondroyd commented 11 months ago

Description

A quick one: I'm a fan of pathlib.Path, which takes care of / vs \ on unix/dos derived OSs, however, it cannot be used as the read_chains root argument since + is not defined for a Path, so I just cast it to string.

This PR puts the cast into read_chains. I have left all the other reading functions unmodified since they aren't intended to be invoked directly.

Fixes #357

Checklist:

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (e5b3bdf) to head (33a473f).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #358 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 34 34 Lines 2978 2979 +1 ========================================= + Hits 2978 2979 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

AdamOrmondroyd commented 8 months ago

will do once #356 is through

AdamOrmondroyd commented 8 months ago

Will be a nice opportunity to test that bump_version actually works on osx after #356 is merged

appetrosyan commented 8 months ago

I could test OS X compat

AdamOrmondroyd commented 8 months ago

If you like, but I'm also on Mac hence #356 in the first place

AdamOrmondroyd commented 8 months ago

If you like, but I'm also on Mac hence #356 in the first place

Will was too fast 😢 was confused why my branch had diverged in seconds

williamjameshandley commented 8 months ago

Ah, apologies for stealing your fun! The bump version isn't much use in a merge resolution anyway. We'll have to wait until a new PR before trying #356 out on macOS

AdamOrmondroyd commented 8 months ago

dw I'll try it out on #359