Skip to content

Better parameterization of APOSMM class, plus docstring - #1583

Merged
jlnav merged 45 commits into
experimental/jlnav_plus_shuds_asktellfrom
asktell/aposmm_fixes
Oct 29, 2025
Merged

Better parameterization of APOSMM class, plus docstring#1583
jlnav merged 45 commits into
experimental/jlnav_plus_shuds_asktellfrom
asktell/aposmm_fixes

Conversation

@jlnav

@jlnav jlnav commented Aug 22, 2025

Copy link
Copy Markdown
Member

No description provided.

jlnav added 3 commits August 21, 2025 15:48
…documenting, and so we don't have to check the existence of settings in kwargso
@codecov

codecov Bot commented Aug 22, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.08333% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.73%. Comparing base (a383dc0) to head (c040721).
⚠️ Report is 238 commits behind head on experimental/jlnav_plus_shuds_asktell.

Files with missing lines Patch % Lines
libensemble/gen_classes/aposmm.py 77.27% 2 Missing and 3 partials ⚠️
libensemble/gen_funcs/aposmm_localopt_support.py 82.60% 2 Missing and 2 partials ⚠️
libensemble/gen_funcs/persistent_aposmm.py 0.00% 0 Missing and 1 partial ⚠️
libensemble/gen_funcs/persistent_ax_multitask.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                            Coverage Diff                            @@
##           experimental/jlnav_plus_shuds_asktell    #1583      +/-   ##
=========================================================================
- Coverage                                  78.75%   78.73%   -0.03%     
=========================================================================
  Files                                         79       79              
  Lines                                       7983     7993      +10     
  Branches                                    1195     1196       +1     
=========================================================================
+ Hits                                        6287     6293       +6     
- Misses                                      1477     1481       +4     
  Partials                                     219      219              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread libensemble/gen_classes/aposmm.py Outdated
gen_specs["user"]["xtol_abs"] = xtol_abs
gen_specs["user"]["ftol_abs"] = ftol_abs
gen_specs["user"]["dist_to_bound_multiple"] = dist_to_bound_multiple
gen_specs["user"]["max_active_runs"] = max_active_runs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

FIELDS = [
    "initial_sample_size",
    "sample_points",
    "localopt_method",
    "rk_const",
    "xtol_abs",
    "ftol_abs",
    "dist_to_bound_multiple",
    "max_active_runs",
]

u = gen_specs.setdefault("user", {})
temp = {}
for k in FIELDS:
    val = locals().get(k)
    if val is not None:
        temp[k] = val
u.update(temp)

or separate required v optional

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Maybe this works but grabbing values from locals() to prevent redundancy just looks odd to me. I can still implement this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Its just a way to convert a string to a function name. Better than typing them all out right?

jlnav added 2 commits August 22, 2025 13:37
… with loop over fields and grabbing the value from locals, as suggested by shuds
@jlnav
jlnav requested a review from shuds13 August 26, 2025 19:27
jlnav and others added 22 commits August 27, 2025 08:08
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.35.7 to 1.36.2.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](crate-ci/typos@v1.35.7...v1.36.2)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-version: 1.36.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…evelop/crate-ci/typos-1.36.2

Bump crate-ci/typos from 1.35.7 to 1.36.2
Bumps the python-updates group with 3 updates in the / directory: [pytest](https://github.com/pytest-dev/pytest), [pytest-cov](https://github.com/pytest-dev/pytest-cov) and [globus-compute-sdk](https://github.com/globus/globus-compute).


Updates `pytest` from 8.4.1 to 8.4.2
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@8.4.1...8.4.2)

Updates `pytest-cov` from 6.2.1 to 7.0.0
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](pytest-dev/pytest-cov@v6.2.1...v7.0.0)

Updates `globus-compute-sdk` from 3.12.0 to 3.13.0
- [Release notes](https://github.com/globus/globus-compute/releases)
- [Changelog](https://github.com/globus/globus-compute/blob/main/docs/changelog.rst)
- [Commits](globus/globus-compute@3.12.0...3.13.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-version: 8.4.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-updates
- dependency-name: pytest-cov
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: python-updates
- dependency-name: globus-compute-sdk
  dependency-version: 3.13.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
…on-updates-a8a26ef096

Bump the python-updates group across 1 directory with 3 updates
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.36.2 to 1.36.3.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](crate-ci/typos@v1.36.2...v1.36.3)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-version: 1.36.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps the python-updates group with 2 updates in the / directory: [globus-compute-sdk](https://github.com/globus/globus-compute) and [anyio](https://github.com/agronholm/anyio).


Updates `globus-compute-sdk` from 3.13.0 to 3.15.0
- [Release notes](https://github.com/globus/globus-compute/releases)
- [Changelog](https://github.com/globus/globus-compute/blob/main/docs/changelog.rst)
- [Commits](globus/globus-compute@3.13.0...3.15.0)

Updates `anyio` from 4.10.0 to 4.11.0
- [Release notes](https://github.com/agronholm/anyio/releases)
- [Changelog](https://github.com/agronholm/anyio/blob/master/docs/versionhistory.rst)
- [Commits](agronholm/anyio@4.10.0...4.11.0)

---
updated-dependencies:
- dependency-name: globus-compute-sdk
  dependency-version: 3.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-updates
- dependency-name: anyio
  dependency-version: 4.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
…evelop/crate-ci/typos-1.36.3

Bump crate-ci/typos from 1.36.2 to 1.36.3
…on-updates-ee952850e7

Bump the python-updates group across 1 directory with 2 updates
Comment thread libensemble/gen_classes/aposmm.py Outdated
self.VOCS = vocs

gen_specs = {}
persis_info = {"1": np.random.default_rng(random_seed)}

@shuds13 shuds13 Oct 1, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why is this with key "1", I dont think we want that.

ftol_abs: float = 1e-6,
dist_to_bound_multiple: float = 0.5,
max_active_runs: int = 6,
random_seed: int = 1,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should default be 0 or 1.

dependabot Bot and others added 14 commits October 6, 2025 19:06
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.36.3 to 1.37.3.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](crate-ci/typos@v1.36.3...v1.37.3)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-version: 1.37.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…evelop/crate-ci/typos-1.37.3

Bump crate-ci/typos from 1.36.3 to 1.37.3
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.37.3 to 1.38.1.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](crate-ci/typos@v1.37.3...v1.38.1)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-version: 1.38.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps the python-updates group with 3 updates: [matplotlib](https://github.com/matplotlib/matplotlib), [globus-compute-sdk](https://github.com/globus/globus-compute) and [rich](https://github.com/Textualize/rich).


Updates `matplotlib` from 3.10.6 to 3.10.7
- [Release notes](https://github.com/matplotlib/matplotlib/releases)
- [Commits](matplotlib/matplotlib@v3.10.6...v3.10.7)

Updates `globus-compute-sdk` from 3.15.0 to 3.16.0
- [Release notes](https://github.com/globus/globus-compute/releases)
- [Changelog](https://github.com/globus/globus-compute/blob/main/docs/changelog.rst)
- [Commits](globus/globus-compute@3.15.0...3.16.0)

Updates `rich` from 14.1.0 to 14.2.0
- [Release notes](https://github.com/Textualize/rich/releases)
- [Changelog](https://github.com/Textualize/rich/blob/master/CHANGELOG.md)
- [Commits](Textualize/rich@v14.1.0...v14.2.0)

---
updated-dependencies:
- dependency-name: matplotlib
  dependency-version: 3.10.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-updates
- dependency-name: globus-compute-sdk
  dependency-version: 3.16.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-updates
- dependency-name: rich
  dependency-version: 14.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
…evelop/crate-ci/typos-1.38.1

Bump crate-ci/typos from 1.37.3 to 1.38.1
…on-updates-345d75facd

Bump the python-updates group with 3 updates
@jlnav
jlnav requested a review from shuds13 October 23, 2025 19:45
Comment thread libensemble/gen_classes/aposmm.py Outdated
rk_const = 0.5 * ((gamma(1 + (self.n / 2)) * 5) ** (1 / self.n)) / sqrt(pi)

gen_specs["user"] = {}
gen_specs["user"]["lb"] = np.array([vocs.variables[i].domain[0] for i in vocs.variables])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is set below

Comment thread libensemble/gen_classes/aposmm.py Outdated
if val is not None:
gen_specs["user"][k] = val

gen_specs["persis_in"] = ["x", "f", "local_pt", "sim_id", "sim_ended", "x_on_cube", "local_min"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is set below without local_min

Comment thread libensemble/gen_classes/aposmm.py Outdated
persis_info = {}
libE_info = {}
gen_specs["gen_f"] = aposmm
self.n = len(list(self.VOCS.variables.keys()))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I removed self.n

@jlnav
jlnav requested a review from shuds13 October 24, 2025 15:23
Comment thread libensemble/gen_classes/aposmm.py Outdated
What fraction of the distance to the nearest boundary should the initial
step size be in localopt runs.

max_active_runs: int = 6

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't be 6

Comment thread libensemble/gen_classes/aposmm.py Outdated
History: npt.NDArray = []
An optional history of previously evaluated points.

initial_sample_size: int = 100

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should be dependent on n or possibly nfmax

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So it's dependent on the problem dimension... as in it's simply a multiple of it, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm making it a required field as we discussed - I'm assuming users will eyeball a good stating size?

…posmm class - and rearrange to be higher in the docstring and signature
@jlnav
jlnav merged commit cd776a1 into experimental/jlnav_plus_shuds_asktell Oct 29, 2025
11 of 12 checks passed
@jlnav
jlnav deleted the asktell/aposmm_fixes branch October 29, 2025 19:15
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.

3 participants