Skip to content

Error when loading reference draws on Python +3.9 #6

@Red-Portal

Description

@Red-Portal

The following basic use case fails on Python 3.13:

from posteriordb import PosteriorDatabaseGithub

pdb   = PosteriorDatabaseGithub()
post  = pdb.posterior("diamonds-diamonds")
ref_samples = post.reference_draws()

Here's the error code:

Traceback (most recent call last):
  File "/home/krkim/Projects/diamonds/test.py", line 16, in <module>
    ref_samples = post.reference_draws()
  File "/home/krkim/.pyenv/versions/diamonds_env/lib/python3.13/site-packages/posteriordb/posterior.py", line 41, in reference_draws
    with ZipFile(self.reference_draws_file_path() + ".zip", "r") as z:
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str'

Apparently, the restrictions on the operators on path objects became stricter since Python 3.9, and this is not allowed anymore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions