Skip to content

Commit

Permalink
fix ambiguous statistical map
Browse files Browse the repository at this point in the history
  • Loading branch information
xgui3783 committed Aug 20, 2024
1 parent e72dd1e commit 546d4d3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/calc_upload_sparseindex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
type: string
description: ""
required: true
mapname:
type: string
description: ""
required: true
secrets:
client-id:
required: true
Expand All @@ -35,7 +39,9 @@ jobs:
python _ci/create_sparse_index.py \
${{ inputs.parcellation_id }} \
${{ inputs.space_id }} \
${{ inputs.filename }}
${{ inputs.filename }} \
statistical \
${{ inputs.mapname }}
- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.filename }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/check-trigger-sparseindex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
parcellation_id: ${{ matrix.parcellation_id }}
space_id: ${{ matrix.space_id }}
filename: ${{ matrix.filename }}
mapname: ${{ matrix.mapname }}
secrets:
client-id: ${{ secrets.EBRAINS_OIDC_SIIBRA_CI_CLIENT_ID }}
client-secret: ${{ secrets.EBRAINS_OIDC_SIIBRA_CI_CLIENT_SECRET }}
Expand Down
8 changes: 7 additions & 1 deletion _ci/check_sparse_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ def main():
map_obj = json.loads(f.read_text())
parcellation_id = map_obj.get("parcellation_id")
space_id = map_obj.get("space_id")
name_attrs = [attr
for attr in map_obj.get("attributes", [])
if attr.get("@type") == "siibra/attr/desc/name/v0.1"]
assert len(name_attrs) == 1, f"{str(f)} has more than 1 name attr"
name = name_attrs[0]["value"]
for attr in map_obj.get("attributes", []):
if attr.get("format") == "sparseindex":
url = attr.get("url")
Expand All @@ -25,7 +30,8 @@ def main():
include.append({
"parcellation_id": parcellation_id,
"space_id": space_id,
"filename": filename.name
"filename": filename.name,
"mapname": name,
})
print(json.dumps(print_result))
return
Expand Down
4 changes: 2 additions & 2 deletions _ci/create_sparse_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from siibra.atlases.sparsemap import SparseIndex
from tqdm import tqdm

def create_sparse_index(parc_id: str, space_id: str, filename: str, maptype: str="statistical"):
mp = siibra.get_map(parc_id, space_id, maptype)
def create_sparse_index(parc_id: str, space_id: str, filename: str, maptype: str="statistical", extra_spec: str=""):
mp = siibra.get_map(parc_id, space_id, maptype, extra_spec)

spi = SparseIndex(filename, mode="w")

Expand Down

0 comments on commit 546d4d3

Please sign in to comment.