diff --git a/.github/workflows/issue_to_jira.yml b/.github/workflows/issue_to_jira.yml index efedc47662..057d07829c 100644 --- a/.github/workflows/issue_to_jira.yml +++ b/.github/workflows/issue_to_jira.yml @@ -1,5 +1,3 @@ -# This workflow will create a JIRA issue upon creation of a GitHub issue - name: Create JIRA issue on: @@ -7,30 +5,8 @@ on: types: [opened] jobs: - new_jira_issue: - runs-on: ubuntu-latest - - steps: - - name: JIRA Login - uses: atlassian/gajira-login@v3.0.1 - env: - JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} - JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} - JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} - - name: Jira Create issue - id: create_jira_issue - uses: atlassian/gajira-create@v3.0.1 - with: - project: GEOPY - issuetype: Story - summary: ${{ github.event.issue.title }} - description: "_from [GitHub issue #${{ github.event.issue.number }}|${{ github.event.issue.html_url }}]_" - # Additional fields in JSON format - fields: '{"components": [{"name": "simpeg"}]}' - - name: Post JIRA link - uses: peter-evans/create-or-update-comment@v3 - with: - # The number of the issue or pull request in which to create a comment. - issue-number: ${{ github.event.issue.number }} - # The comment body. - body: "JIRA issue [${{ steps.create_jira_issue.outputs.issue }}] was created." + call-workflow-create-jira-issue: + uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-issue_to_jira.yml@main + secrets: inherit + with: + project-key: 'GEOPY' diff --git a/.github/workflows/pr_add_jira_summary.yml b/.github/workflows/pr_add_jira_summary.yml index f0c8a8dda0..794bf3f0b1 100644 --- a/.github/workflows/pr_add_jira_summary.yml +++ b/.github/workflows/pr_add_jira_summary.yml @@ -1,6 +1,3 @@ -# This workflow will comment the PR with the JIRA issue summary -# if a JIRA issue number is detected in the branch name or title - name: Add JIRA issue summary on: @@ -8,57 +5,6 @@ on: types: [opened] jobs: - add_jira_summary: - runs-on: ubuntu-latest - - steps: - - name: Find JIRA issue key - id: find_jira_key - env: - HEAD_REF: ${{ github.head_ref}} - PR_TITLE: ${{ github.event.pull_request.title }} - run: > - echo $HEAD_REF $PR_TITLE - | echo "issue_key=$( - grep -osi "\b\(GA\|GEOPY\|DEVOPS\)[ #-]*[0-9]\+" - | head -n1 - | sed -E "s/([A-Z]+)[-# ]*([0-9]+)/\1-\2/i" - | tr [:lower:] [:upper:] - )" - >> $GITHUB_OUTPUT - - name: Get JIRA summary - id: get_jira_summary - if: ${{ steps.find_jira_key.outputs.issue_key }} - env: - JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} - JIRA_BASIC_AUTH: ${{ secrets.JIRA_BASIC_AUTH }} - run: > - curl -sS -X GET - -H "Authorization: Basic $JIRA_BASIC_AUTH" - -H "Content-Type: application/json" - "$JIRA_BASE_URL/rest/api/2/issue/${{ steps.find_jira_key.outputs.issue_key }}" - | echo "summary=$(jq -r '.fields.summary // empty')" >> $GITHUB_OUTPUT - - name: Extract PR title - id: get_pr_title - env: - PR_TITLE: ${{ github.event.pull_request.title }} - run: | - echo "text=$(echo $PR_TITLE | sed -E "s/^\s*[?[A-Z]+[-# ]*[0-9]+]?[-: ]*(.*)/\1/i")" >> $GITHUB_OUTPUT - - name: Add comment - if: ${{ steps.find_jira_key.outputs.issue_key }} - env: - ISSUE_SUMMARY: ${{ steps.get_jira_summary.outputs.summary }} - TITLE_TEXT: ${{ steps.get_pr_title.outputs.text }} - PR_BODY: ${{ github.event.pull_request.body }} - run: > - jq - --arg ISSUE_ID "${{ steps.find_jira_key.outputs.issue_key }}" - --arg ISSUE_SUMMARY "$(cat <<< $ISSUE_SUMMARY)" - --arg TITLE_TEXT "$(cat <<< ${TITLE_TEXT:-$ISSUE_SUMMARY})" - --arg PR_BODY "$(cat <<< $PR_BODY)" - -c '{"title": ($ISSUE_ID + ": " + $TITLE_TEXT), "body": ("**" + $ISSUE_ID + " - " + $ISSUE_SUMMARY + "**\n" + $PR_BODY)}' <<< {} - | curl -sS -X POST -d @- - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" - -H "Content-Type: application/json" - "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls/${{ github.event.pull_request.number }}" - > /dev/null + call-workflow-add-jira-issue-summary: + uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-pr_add_jira_summary.yml@main + secrets: inherit diff --git a/meta.yaml b/meta.yaml index 0efacff965..351a5dbd7b 100644 --- a/meta.yaml +++ b/meta.yaml @@ -1,5 +1,5 @@ {% set name = "mira-simpeg" %} -{% set version = "0.21.2.1b3" %} +{% set version = "0.21.2.1rc1" %} package: name: {{ name|lower }} @@ -15,7 +15,7 @@ build: requirements: host: - - python >=3.10 + - python >=3.10.0,<3.12.0 - poetry-core >=1.0.0 - setuptools >=64 - setuptools_scm >=8 diff --git a/simpeg/dask/potential_fields/base.py b/simpeg/dask/potential_fields/base.py index 3c5d05aedd..92424ad8b4 100644 --- a/simpeg/dask/potential_fields/base.py +++ b/simpeg/dask/potential_fields/base.py @@ -93,13 +93,13 @@ def dask_linear_operator(self): # Check that loaded kernel matches supplied data and mesh print("Zarr file detected with same shape and chunksize ... re-loading") return kernel - else: - print("Writing Zarr file to disk") - with ProgressBar(): - print("Saving kernel to zarr: " + sens_name) - kernel = array.to_zarr( - stack, sens_name, compute=True, return_stored=True, overwrite=True - ) + + print("Writing Zarr file to disk") + with ProgressBar(): + print("Saving kernel to zarr: " + sens_name) + kernel = array.to_zarr( + stack, sens_name, compute=True, return_stored=True, overwrite=True + ) elif forward_only: with ProgressBar(): print("Forward calculation: ") diff --git a/simpeg/potential_fields/base.py b/simpeg/potential_fields/base.py index 0eddf36e3a..c6da7258d0 100644 --- a/simpeg/potential_fields/base.py +++ b/simpeg/potential_fields/base.py @@ -75,7 +75,6 @@ def __init__( self, mesh, ind_active=None, - store_sensitivities="ram", n_processes=1, sensitivity_dtype=np.float32, engine="geoana", @@ -93,7 +92,6 @@ def __init__( "forwardOnly was removed in SimPEG 0.17.0, please set store_sensitivities=None" ) - self.store_sensitivities = store_sensitivities self.sensitivity_dtype = sensitivity_dtype self.engine = engine self.numba_parallel = numba_parallel @@ -148,31 +146,6 @@ def __init__( self._nodes = nodes[unique] # unique active nodes self._unique_inv = unique_inv.reshape(cell_nodes.T.shape) - @property - def store_sensitivities(self): - """Options for storing sensitivities. - - There are 3 options: - - - 'ram': sensitivity matrix stored in RAM - - 'disk': sensitivities written and stored to disk - - 'forward_only': sensitivities are not store (only use for forward simulation) - - Returns - ------- - {'disk', 'ram', 'forward_only'} - A string defining the model type for the simulation. - """ - if self._store_sensitivities is None: - self._store_sensitivities = "ram" - return self._store_sensitivities - - @store_sensitivities.setter - def store_sensitivities(self, value): - self._store_sensitivities = validate_string( - "store_sensitivities", value, ["disk", "ram", "forward_only"] - ) - @property def sensitivity_dtype(self): """dtype of the sensitivity matrix.