Skip to content

Update fit_catalogue.py - #120

Open
PJ-Watson wants to merge 1 commit into
ACCarnall:masterfrom
PJ-Watson:patch-1
Open

Update fit_catalogue.py#120
PJ-Watson wants to merge 1 commit into
ACCarnall:masterfrom
PJ-Watson:patch-1

Conversation

@PJ-Watson

Copy link
Copy Markdown

This line throws the following error in my environment with pandas==3.0.3 and numpy==2.4.6 (and this is the only line which has caused any problems with those two package versions):

Traceback (most recent call last):
  File "/media/sharedData/python/py3.13_PIE/code/PASSAGE_scripts/3__SED_fitting/run_fits.py", line 214, in <module>
    cat_fit.fit(n_live=400, verbose=True, mpi_serial=False, track_backlog=True)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/sharedData/python/py3.13_PIE/lib/python3.13/site-packages/bagpipes/catalogue/fit_catalogue.py", line 190, in fit
    self.done[i] = True
    ~~~~~~~~~^^^
ValueError: assignment destination is read-only

I'm pretty sure this is the new pandas 3.0 copy-on-write behaviour (or less likely, some other minor update to numpy that I overlooked), so creating self.done explicitly as a numpy array solves the problem.

Fix read-only destination error (pandas CoW update)
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.

1 participant