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

Fix passing compute to export_solver with features attached #922

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

kecnry
Copy link
Member

@kecnry kecnry commented Jul 21, 2024

This PR fixes a traceback that occurred when calling b.export_solver(compute='...', ...) with features attached.

This closes #920.

@kecnry kecnry mentioned this pull request Jul 21, 2024
@kecnry kecnry requested a review from aprsa July 21, 2024 17:48
compute = solver_ps.get_value(qualifier='compute', compute=kwargs.get('compute', None), default=[], **_skip_filter_checks)
compute = kwargs.get('compute', solver_ps.get_value(qualifier='compute', **_skip_filter_checks))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To override a parameter value from a kwarg, we usually call parameter_name=kwargs.get('parameter_name', None) which results in returning the value in the kwarg if provided, and otherwise the parameter value itself. However, in this case, the parameter name is compute but that clashes with the compute tag resulting in no results. The new line should result in the same intended logic, but bypasses the filter entirely and prevents the tag collision.

The only downside to this approach being used widely is that it also bypasses validity checks, etc, but in this case those would result in errors in the following line. If this ever became a problem, we could add logic to ensure that the user-passed value for compute is a valid option and raise a useful error if it is not.

@aprsa
Copy link
Contributor

aprsa commented Aug 27, 2024

The CI build issue must be unrelated to this PR; if possible, it'd be good to first resolve the CI issue and then rerun to have a clean PR merge. Otherwise, I have no issues with the proposed fix.

@kecnry
Copy link
Member Author

kecnry commented Aug 27, 2024

rebased onto the fixed bugfix branch, I'll merge if/when CI is green 🟢 🤞

@kecnry kecnry merged commit d29803b into phoebe-project:bugfix-2.4.15 Aug 27, 2024
15 checks passed
@kecnry kecnry deleted the export-solver-features branch August 27, 2024 22:58
@kecnry kecnry mentioned this pull request Oct 3, 2024
kecnry added a commit that referenced this pull request Oct 3, 2024
* Fix handling of include_times for RVs with compute_times/phases. [#889]
* GPs on models computed in phase-space will be properly computed based on residuals in time space. [#899]
* Fix units of requivfrac. [#894]
* Fix adopting mask_phases from lc_geometry. [#896]
* Fix population of wavelength array in load function for passbands. [#914]
* Temporarily cap numpy dependency < 2.0. [#930]
* Fix installation of phoebe-server CLI script to launch from UI. [#929]
* Fix passing compute to export_solver with features attached. [#922]
* sigmas_lnf: change handling of noise-nuissance parameter for RVs to no longer depend on the RV amplitude. [#901]
* Remove duplicated phoebe-server code. [#940]
* Fix python 3.12+ support by updating invalid escape sequences. [#948]
* Improved precision in calculation of constraints. [#945]

---------

Co-authored-by: Kelly Hambleton (Prsa) <kmhambleton@gmail.com>
Co-authored-by: David Jones <Raindogjones@users.noreply.github.com>
Co-authored-by: Andrej Prsa <aprsa@villanova.edu>
Co-authored-by: Matthias Fabry <matthias.fabry@villanova.edu>
Co-authored-by: Matthias Fabry <matthias.fabry@kuleuven.be>
Co-authored-by: Miroslav Broz <miroslav.broz@email.cz>
aprsa added a commit that referenced this pull request Oct 8, 2024
commit 34281b8
Merge: 1584f6c 22fa0db
Author: Kyle Conroy <kyleconroy@gmail.com>
Date:   Mon Oct 7 15:16:16 2024 -0400

    Merge 2.4.15 into release-2.5

commit 22fa0db
Author: Kyle Conroy <kyleconroy@gmail.com>
Date:   Mon Oct 7 11:20:56 2024 -0400

    modified publish workflow (#952)

    * modified publish workflow using same as https://github.com/aprsa/ndpolator/blob/main/.github/workflows/on_release.yaml
    * address build wheel warnings
    * bump ubuntu runner to 24.04
    * upgrade cibuildwheel
    * skip failing builds

commit fbde243
Author: Kyle Conroy <kyleconroy@gmail.com>
Date:   Thu Oct 3 15:48:13 2024 -0400

    2.4.15 bugfix release (#907)

    * Fix handling of include_times for RVs with compute_times/phases. [#889]
    * GPs on models computed in phase-space will be properly computed based on residuals in time space. [#899]
    * Fix units of requivfrac. [#894]
    * Fix adopting mask_phases from lc_geometry. [#896]
    * Fix population of wavelength array in load function for passbands. [#914]
    * Temporarily cap numpy dependency < 2.0. [#930]
    * Fix installation of phoebe-server CLI script to launch from UI. [#929]
    * Fix passing compute to export_solver with features attached. [#922]
    * sigmas_lnf: change handling of noise-nuissance parameter for RVs to no longer depend on the RV amplitude. [#901]
    * Remove duplicated phoebe-server code. [#940]
    * Fix python 3.12+ support by updating invalid escape sequences. [#948]
    * Improved precision in calculation of constraints. [#945]

    ---------

    Co-authored-by: Kelly Hambleton (Prsa) <kmhambleton@gmail.com>
    Co-authored-by: David Jones <Raindogjones@users.noreply.github.com>
    Co-authored-by: Andrej Prsa <aprsa@villanova.edu>
    Co-authored-by: Matthias Fabry <matthias.fabry@villanova.edu>
    Co-authored-by: Matthias Fabry <matthias.fabry@kuleuven.be>
    Co-authored-by: Miroslav Broz <miroslav.broz@email.cz>

commit bf850e1
Author: Kyle Conroy <kyleconroy@gmail.com>
Date:   Thu Oct 3 11:02:38 2024 -0400

    release GH actions workflow (#949)
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.

2 participants