Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solver backends should support multiple compute options #879

Open
kecnry opened this issue May 31, 2024 · 0 comments
Open

solver backends should support multiple compute options #879

kecnry opened this issue May 31, 2024 · 0 comments

Comments

@kecnry
Copy link
Member

kecnry commented May 31, 2024

see #877 for a use case and example:

import phoebe

b = phoebe.default_binary()
b.add_spot(component='primary', relteff=0.8, feature='spot01')

# add multiple datasets, each dataset will either have the spot enabled or disabled via separate compute options
# for this example, we'll just add one of each
b.add_dataset('lc', compute_phases=phoebe.linspace(0,1,101), dataset='lc_with_spot')
b.add_dataset('lc', compute_phases=phoebe.linspace(0,1,101), dataset='lc_without_spot')

# now we'll create separate compute options: one which will handle all datasets with the spot enabled and one
# for all datasets with the spot disabled
b.add_compute('phoebe', compute='comp_with_spot')
b.set_value('enabled', dataset='lc_without_spot', compute='comp_with_spot', value=False)

b.add_compute('phoebe', compute='comp_without_spot')
b.set_value('enabled', dataset='lc_with_spot', compute='comp_without_spot', value=False)
b.set_value('enabled', feature='spot01', compute='comp_without_spot', value=False)

b.run_compute(compute=['comp_with_spot', 'comp_without_spot'])

b.add_solver('optimizer.nedler_mead')
# want to be able to support something like the following by using a Select instead of a Choice parameter:
b.set_value('compute', context='solver', value='comp_*_spot')
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

No branches or pull requests

1 participant