-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #181 from reflectometry/webview
Webview
- Loading branch information
Showing
126 changed files
with
5,956 additions
and
1,523 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
name: Build webview with Jupyter for macos | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
branch_name: webview | ||
|
||
jobs: | ||
test_and_build: | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
matrix: | ||
config: | ||
#- { os: ubuntu-latest, py: 3.8, doc: 1 } | ||
# - { os: windows-latest, py: "3.10", exe: 1, whl: 1 } | ||
- { os: macos-latest, py: "3.10", whl: 1 } | ||
# all using to stable abi | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ env.branch_name }} | ||
|
||
- name: Set up Python ${{ matrix.config.py }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.config.py }} | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.config.py }} | ||
|
||
- name: Build installer | ||
run: | | ||
./extra/build_conda_packed_jupyter.sh | ||
mkdir unstable | ||
pwd | ||
mv refl1d-webview* ./unstable/ | ||
# See the following for how to upload to a release | ||
# https://eugene-babichenko.github.io/blog/2020/05/09/github-actions-cross-platform-auto-releases/ | ||
- name: Archive artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifacts | ||
path: | | ||
unstable/* | ||
updateUnstable: | ||
needs: test_and_build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Retrieve all artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: artifacts | ||
|
||
- name: show files | ||
run: | | ||
ls * -l | ||
- name: Update release assets and text | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
const fs = require('fs'); | ||
const { owner, repo } = context.repo; | ||
let sid_release = await github.rest.repos.getReleaseByTag({ | ||
owner, | ||
repo, | ||
tag: "sid" | ||
}); | ||
await github.rest.repos.updateRelease({ | ||
owner, | ||
repo, | ||
release_id: sid_release.data.id, | ||
body: "A persistent prerelease where build artifacts for the current tip will be deposited\n\n## Last updated: " + (new Date()).toDateString() | ||
}); | ||
// delete existing release assets (if needed) and upload new ones: | ||
const globber = await glob.create("**"); | ||
const to_update = await globber.glob(); | ||
// const to_update = ["refl1d-webview-jupyter-0.8.15-Darwin-arm64.tar.gz", "refl1d-webview-jupyter.pkg"]; | ||
for (let fn of to_update) { | ||
let asset_id = (sid_release.data.assets.find((a) => (a.name == fn)) ?? {}).id; | ||
if (asset_id) { | ||
await github.rest.repos.deleteReleaseAsset({ | ||
owner, | ||
repo, | ||
asset_id | ||
}); | ||
} | ||
await github.rest.repos.uploadReleaseAsset({ | ||
owner, | ||
repo, | ||
release_id: sid_release.data.id, | ||
name: fn, | ||
data: await fs.readFileSync(fn) | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: Build webview for linux | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
branch_name: webview | ||
|
||
jobs: | ||
test_and_build: | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
matrix: | ||
config: | ||
- { os: ubuntu-latest, py: 3.11, whl: 1 } | ||
# - { os: windows-latest, py: "3.10", exe: 1, whl: 1 } | ||
# - { os: macos-latest, py: "3.10", whl: 1 } | ||
# all using to stable abi | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ env.branch_name }} | ||
|
||
- name: Set up Python ${{ matrix.config.py }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.config.py }} | ||
|
||
- uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.config.py }} | ||
|
||
- name: Build webview packed (linux) | ||
run: | | ||
./extra/build_conda_packed.sh | ||
mkdir unstable | ||
pwd | ||
mv refl1d-webview* ./unstable/ | ||
# See the following for how to upload to a release | ||
# https://eugene-babichenko.github.io/blog/2020/05/09/github-actions-cross-platform-auto-releases/ | ||
- name: Archive artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifacts | ||
path: | | ||
unstable/* | ||
updateUnstable: | ||
needs: test_and_build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Retrieve all artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: artifacts | ||
|
||
- name: show files | ||
run: | | ||
ls * -l | ||
- name: Update release assets and text | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { owner, repo } = context.repo; | ||
let sid_release = await github.rest.repos.getReleaseByTag({ | ||
owner, | ||
repo, | ||
tag: "sid" | ||
}); | ||
await github.rest.repos.updateRelease({ | ||
owner, | ||
repo, | ||
release_id: sid_release.data.id, | ||
body: "A persistent prerelease where build artifacts for the current tip will be deposited\n\n## Last updated: " + (new Date()).toDateString() | ||
}); | ||
// delete existing release assets (if needed) and upload new ones: | ||
const globber = await glob.create("*", {followSymbolicLinks: false}); | ||
const full_paths = await globber.glob(); | ||
const to_update = full_paths.map((f) => path.basename(f)); | ||
console.log({to_update}); | ||
// const to_update = ["refl1d-webview-jupyter-0.8.15-Darwin-arm64.tar.gz", "refl1d-webview-jupyter.pkg"]; | ||
for (let fn of to_update) { | ||
let asset_id = (sid_release.data.assets.find((a) => (a.name == fn)) ?? {}).id; | ||
if (asset_id) { | ||
await github.rest.repos.deleteReleaseAsset({ | ||
owner, | ||
repo, | ||
asset_id | ||
}); | ||
} | ||
await github.rest.repos.uploadReleaseAsset({ | ||
owner, | ||
repo, | ||
release_id: sid_release.data.id, | ||
name: fn, | ||
data: await fs.readFileSync(fn) | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,4 @@ | |
|
||
#M.simulate_data(5) | ||
|
||
problem = MultiFitProblem([M1,M2,M5]) | ||
problem = FitProblem([M1,M2,M5]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Explore | ||
|
||
Files in this folder are for exploration of new algorithms or functionality that is not ready to be included in the main tree. | ||
|
||
_No tests will be applied to this folder_ |
File renamed without changes.
Oops, something went wrong.