dfm / dfm/python-fsps

Multiple StellarPopulation instances

Open
#60 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
76
Forks
45
PR merge metrics
No merged PRs in 30d

Description

Because parameter state and dirtiness is specific to each instance, but the computed model is held by the module level driver object, having multiple StellarPopulation instances can cause a model to not be recomputed even though it should be (example code below) This might also cause problems with shared memory multiprocessing.

Some documentation advising only a single sps instance per program might be a good idea.

from numpy.testing import assert_allclose
import fsps
sps = fsps.StellarPopulation(zcontinuous=1, vactoair_flag=False)
pop = fsps.StellarPopulation(zcontinuous=1, vactoair_flag=False)
w1, s1 = sps.get_spectrum(tage=10.0)
w, s = pop.get_spectrum(tage=1.0)
w2, s2 = sps.get_spectrum(tage=10.0)
assert_allclose(s, s2) # this should not pass, but does
assert_allclose(s1, s2) # this should not fail, but does

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with StellarPopulation.get_spectrum and the module-level driver state described in the issue. Reproduce the supplied sequence with two instances, then trace how parameter dirtiness and model recomputation are shared. Done means each instance returns results consistent with its own parameters, including the two assertions in the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran, python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.