Multiple StellarPopulation instances
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
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.
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
- Dominant language
- Python
- Stars
- 76
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dfm/python-fsps
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
dfm/python-fsps#121 ·
-
Performance question Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
dfm/python-fsps#350 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
dfm/python-fsps#229 · 8 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
dfm/python-fsps#217 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
dfm/python-fsps#199 · 4 comments ·
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100