From d072621ac85c92d14ca3842183ed108e193f02ff Mon Sep 17 00:00:00 2001 From: Kevin Stone Date: Fri, 9 Aug 2024 17:29:56 -0400 Subject: [PATCH 1/5] Fixed surface_plot bug when only 2 params are present --- obsidian/plotting/plotly.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/obsidian/plotting/plotly.py b/obsidian/plotting/plotly.py index 5df6826..55b1a20 100644 --- a/obsidian/plotting/plotly.py +++ b/obsidian/plotting/plotly.py @@ -299,13 +299,16 @@ def surface_plot(optimizer: Optimizer, if plot_data: # Use a marker size which is larger if closer to the "other" values of the surface # Smaller markers mean there are other variables pulling it away from the surface plot - X_t_train_ex = optimizer.X_t_train.copy().drop(columns=[X0_name, X1_name]).values - X_t_test_ex = optimizer.X_space.encode(X_test.copy().drop(columns=[X0_name, X1_name]).drop_duplicates()).values - - if X_t_train_ex.shape[0] > 1: - X_t_dist = np.linalg.norm(X_t_train_ex-X_t_test_ex, ord=2, axis=1) - X_t_dist_scaled = (X_t_dist - X_t_dist.min())/(X_t_dist.max()-X_t_dist.min()) - dist_scaled = 15-10*X_t_dist_scaled + if len(optimizer.X_space) != 2: + X_t_train_ex = optimizer.X_t_train.copy().drop(columns=[X0_name, X1_name]).values + X_t_test_ex = optimizer.X_space.encode(X_test.copy().drop(columns=[X0_name, X1_name]).drop_duplicates()).values + + if X_t_train_ex.shape[0] > 1: + X_t_dist = np.linalg.norm(X_t_train_ex-X_t_test_ex, ord=2, axis=1) + X_t_dist_scaled = (X_t_dist - X_t_dist.min())/(X_t_dist.max()-X_t_dist.min()) + dist_scaled = 15-10*X_t_dist_scaled + else: + dist_scaled = 10 else: dist_scaled = 10 From 45e3a7f0341981ea8bfd1a4a2449e42f5323579a Mon Sep 17 00:00:00 2001 From: Kevin Stone Date: Fri, 9 Aug 2024 17:30:54 -0400 Subject: [PATCH 2/5] Bump version --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f777954..92a52b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Modified - Renamed aq_func hyperparmeter "Xi_f" to "inflate" - Moved default aq_func choices for single/multi into aq_defaults of acquisition.config +- Fixed and improved campaign analysis methods ## [0.7.11] ### Added From c2c564a6a9ce2be87f79183061a30cdbaad12a41 Mon Sep 17 00:00:00 2001 From: Kevin Stone <91576158+kstone40@users.noreply.github.com> Date: Mon, 12 Aug 2024 21:28:12 -0400 Subject: [PATCH 3/5] Create documentation.yml --- .github/workflows/documentation.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/documentation.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..de6d8cf --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,27 @@ +name: documentation + +on: [push, pull_request, workflow_dispatch] + +permissions: + contents: write + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install dependencies + run: | + pip install obsidian-apo[docs] + - name: Sphinx build + run: | + sphinx-build docs _build + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + with: + publish_branch: gh_pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: _build/ + force_orphan: true From 9960e8afd846b16e6b3f5014ac0e9f263e16549e Mon Sep 17 00:00:00 2001 From: Kevin Stone <91576158+kstone40@users.noreply.github.com> Date: Mon, 12 Aug 2024 21:32:07 -0400 Subject: [PATCH 4/5] Fixed branch typo in documentation.yml --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index de6d8cf..b57de56 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -21,7 +21,7 @@ jobs: uses: peaceiris/actions-gh-pages@v3 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} with: - publish_branch: gh_pages + publish_branch: gh-pages github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: _build/ force_orphan: true From a3c9e4395834d92ab1d62eb4ef4acad67c26f88a Mon Sep 17 00:00:00 2001 From: Kevin Stone Date: Mon, 12 Aug 2024 21:41:32 -0400 Subject: [PATCH 5/5] Deprecated readthedocs for GH pages --- .readthedocs.yaml | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml deleted file mode 100644 index 13d6978..0000000 --- a/.readthedocs.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# Read the Docs configuration file for Sphinx projects -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required -version: 2 - -# Set the OS, Python version and other tools you might need -build: - os: ubuntu-22.04 - tools: - python: "3.10" - nodejs: "18" - rust: "1.64" - golang: "1.19" - -# Build documentation in the "docs/" directory with Sphinx -sphinx: - configuration: docs/conf.py - # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs - # builder: "dirhtml" - # Fail on all warnings to avoid broken references - # fail_on_warning: true - -# Optionally build your docs in additional formats such as PDF and ePub -# formats: -# - pdf -# - epub - -# Optional but recommended, declare the Python requirements required -# to build your documentation -# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html -python: - install: - - method: pip - path: . - extra_requirements: - - docs \ No newline at end of file