diff --git a/.github/workflows/build_mask.yml b/.github/workflows/build_mask.yml new file mode 100644 index 0000000..3b0160c --- /dev/null +++ b/.github/workflows/build_mask.yml @@ -0,0 +1,36 @@ +# https://github.com/actions/upload-artifact +name: Build and upload mask with DRC + +on: + pull_request: + push: + +jobs: + test_mask: + runs-on: ${{ matrix.os }} + strategy: + max-parallel: 12 + matrix: + python-version: ["3.10"] + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: "pip" + cache-dependency-path: pyproject.toml + - name: Install dependencies + run: | + make install + - name: build mask + run: | + make mask + pip freeze > requirements.txt + cp requirements.txt build/ + - uses: actions/upload-artifact@v3 + with: + name: mask + path: build diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml deleted file mode 100644 index b80a94a..0000000 --- a/.github/workflows/pages.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Sphinx docs to gh-pages - -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - build-docs: - runs-on: ubuntu-latest - name: Sphinx docs to gh-pages - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - cache: "pip" - cache-dependency-path: pyproject.toml - - name: Installing the library - shell: bash -l {0} - run: | - make dev - - name: make docs - run: | - make docs - - name: Upload artifact - uses: actions/upload-pages-artifact@v2 - with: - path: "./docs/_build/html/" - deploy-docs: - needs: build-docs - permissions: - pages: write - id-token: write - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - runs-on: ubuntu-latest - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2 diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml deleted file mode 100644 index c9205f3..0000000 --- a/.github/workflows/release-drafter.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Release Drafter - -on: - push: - branches: - - main - # pull_request: - # types: [opened, reopened, synchronize] - -permissions: - contents: read - -jobs: - update_release_draft: - permissions: - # write permission is required to create a github release - contents: write - # write permission is required for autolabeler - # otherwise, read permission is required at least - pull-requests: write - runs-on: ubuntu-latest - steps: - # (Optional) GitHub Enterprise requires GHE_HOST variable set - #- name: Set GHE_HOST - # run: | - # echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV - - # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5 - # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml - # with: - # config-name: my-config.yml - # disable-autolabeler: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 70265f5..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Release PyPI, installers and docker container - -on: - push: - tags: "v*" - -jobs: - release_pypi: - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.x - cache-dependency-path: pyproject.toml - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - make build - twine upload dist/* - - - release_environment: - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.11' - cache: "pip" - cache-dependency-path: pyproject.toml - - name: Install dependencies - run: | - pip install . - pip freeze > requirements.txt - - name: Publish Latest Draft - run: | - gh release edit ${{ github.ref_name }} --draft=false - gh release upload ${{ github.ref_name }} requirements.txt --clobber - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index a1d5539..0000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,26 +0,0 @@ -# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. -# -# You can adjust the behavior by modifying this file. -# For more information, see: -# https://github.com/actions/stale -name: Mark stale issues and pull requests - -on: - schedule: - - cron: '22 12 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - - steps: - - uses: actions/stale@v8 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue is stale because it has been inactive for 60 days. Remove stale label or comment or this will be closed in 7 days.' - stale-pr-message: 'This pull request is stale because it has been inactive for 60 days. Remove stale label or comment or this will be closed in 7 days.' - stale-issue-label: 'no-issue-activity' - stale-pr-label: 'no-pr-activity' diff --git a/.github/workflows/test_code_conda.yml b/.github/workflows/test_code_conda.yml deleted file mode 100644 index 70be8f4..0000000 --- a/.github/workflows/test_code_conda.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Test pre-commit, code and docs - -on: - pull_request: - push: - branches: - - main - -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - cache-dependency-path: pyproject.toml - - name: Test pre-commit hooks - run: | - python -m pip install --upgrade pip - pip install pre-commit - pre-commit run -a - test_code: - needs: [pre-commit] - runs-on: ${{ matrix.os }} - strategy: - max-parallel: 12 - matrix: - python-version: ["3.10"] - os: [ubuntu-latest, windows-latest, macos-latest] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - cache-dependency-path: pyproject.toml - - name: Install dependencies - run: | - make dev - - name: Test with pytest - run: pytest - test_code_coverage: - runs-on: ubuntu-latest - needs: [pre-commit] - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Install dependencies - run: | - make dev - - name: Test with pytest - run: | - pytest --cov={{ cookiecutter.package_name }} {{ cookiecutter.package_name }} - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: false - test_docs: - needs: [pre-commit] - runs-on: ${{ matrix.os }} - strategy: - max-parallel: 12 - matrix: - python-version: ['3.10'] - os: [ubuntu-latest] - - steps: - - uses: actions/checkout@v4 - - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: '3.10' - mamba-version: "*" - channels: conda-forge,defaults - channel-priority: true - activate-environment: anaconda-client-env - - name: Add conda to system path - run: | - echo $CONDA/bin >> $GITHUB_PATH - - name: Install dependencies - run: | - make dev - - name: Test documentation - run: | - make docs diff --git a/ubc2/ubc_joaquin_matres1.py b/ubc2/ubc_joaquin_matres1.py index 88db758..4c20f5c 100644 --- a/ubc2/ubc_joaquin_matres1.py +++ b/ubc2/ubc_joaquin_matres1.py @@ -123,7 +123,7 @@ def test_mask4() -> Path: def test_mask5() -> Path: """Ring resonators.""" - rings = [pdk.ring_single_heater(length_x=length_x) for length_x in [4, 6]] + rings = [pdk.ring_double_heater(length_x=length_x) for length_x in [2]] rings = [gf.functions.rotate180(ring) for ring in rings] rings_gc = [pdk.add_fiber_array_pads_rf(ring) for ring in rings] @@ -194,7 +194,7 @@ def test_mask7() -> Path: # c = test_mask2() # spirals # c = test_mask3() # coupler and crossing # c = test_mask4() # heated mzis - # c = test_mask5() # heated rings + c = test_mask5() # heated rings # c = test_mask6() # 1x2 mmis # c = test_mask7() # 2x2mmis gf.show(c)