Skip to content

Commit

Permalink
Merge branch 'master' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
matyasselmeci authored Sep 24, 2024
2 parents 22b25d8 + 593e2b5 commit 3a98c5c
Show file tree
Hide file tree
Showing 244 changed files with 1,202 additions and 104 deletions.
64 changes: 64 additions & 0 deletions .github/scripts/check_facility_has_institution_id/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Run through all the FACILITY.yaml files and check that they have an institution_id field.

import yaml
import sys
import glob
import requests

export_mapping = False

# Get the list of valid institution ids
response = requests.get("https://topology-institutions.osg-htc.org/api/institution_ids")
topology_institutions = response.json()
topology_institutions_by_id = {x['id']: x for x in topology_institutions}
topology_institution_ids = {x['id'] for x in topology_institutions}

def check_facility_institution_id(yaml_string: str):

facility = yaml.load(yaml_string, Loader=yaml.Loader)
if 'InstitutionID' not in facility:
raise Exception("FACILITY.yaml does not have an InstitutionID field")

if facility['InstitutionID'] not in topology_institution_ids and facility['InstitutionID'] is not None:
raise Exception(f"Invalid InstitutionID: {facility['InstitutionID']}")

def provide_human_check_interface(facility_files: list):

facility_institution_mapping = {}
for file in facility_files:
with open(file, 'r') as f:
facility_name = file.split('/')[-2]
facility = yaml.load(f, Loader=yaml.Loader)
facility_institution_mapping[facility_name] = topology_institutions_by_id.get(facility['InstitutionID'], {}).get('name', None)

if export_mapping:
with open("facility_institution_mapping.yaml", 'w') as f:
yaml.dump(facility_institution_mapping, f)

else:
print(facility_institution_mapping)

def main():

facility_files = glob.glob("../../../topology/**/FACILITY.yaml")

# Check the files
errors = []
for file in facility_files:
with open(file, 'r') as f:
try:
check_facility_institution_id(f)
except Exception as e:
errors.append((file.split("/")[-2], e))

# Print the errors and exit if needed
if errors:
for error in errors:
print(f"Error in {error[0]}: \n\t {error[1]}")
sys.exit(1)

provide_human_check_interface(facility_files)


if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PyYAML==6.0.1
requests==2.32.0
20 changes: 20 additions & 0 deletions .github/workflows/check_facility_institution_id.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check Project FOS Precision
on:
pull_request:
branches:
- main

jobs:
check:
name: Check
runs-on: ubuntu-latest
if: startsWith(github.repository, 'opensciencegrid/')
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9.15
cache: 'pip' # caching pip dependencies
- run: pip install -r ./.github/scripts/check_facility_has_institution_id/requirements.txt
- run: python ./.github/scripts/check_facility_has_institution_id/main.py
4 changes: 2 additions & 2 deletions .github/workflows/check_project_fos_precision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Check Project FOS Precision
on:
pull_request:
branches:
- main
- master
schedule:
- cron: '0 0 * * *'

Expand All @@ -19,4 +19,4 @@ jobs:
python-version: 3.9.15
cache: 'pip' # caching pip dependencies
- run: pip install -r ./.github/scripts/check_project_fos_precision/requirements.txt
- run: python ./.github/scripts/check_project_fos_precision/main.py
- run: python ./.github/scripts/check_project_fos_precision/main.py
7 changes: 7 additions & 0 deletions projects/CSU_Vogeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Department: Natural Resource Ecology Lab
Description: Distributed geospatial data access and processing
FieldOfScience: Ecological and Environmental Sciences
FieldOfScienceID: '03.0101'
InstitutionID: https://osg-htc.org/iid/2aj5pa9etoc7
Organization: Colorado State University
PIName: Jody Vogeler
12 changes: 12 additions & 0 deletions projects/Illinois_Park.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Department: Statistics
Description: 'My research broadly focuses on (a) causal inference under interference
and non-i.i.d. settings, (b) causal inference under unmeasured confounding, and
(c) optimal treatment regimes and policy learning. A common theme in my research
is to use non/semiparametric theory and optimization methods to develop efficient
and robust estimators of causal quantities in (a)-(c).
Website: https://www.chanpark.net/'
FieldOfScience: Statistics
FieldOfScienceID: '27.0503'
InstitutionID: https://osg-htc.org/iid/10izzs5e7v1r
Organization: University of Illinois Urbana-Champaign
PIName: Chan Park
7 changes: 7 additions & 0 deletions projects/SLU_Ahn.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Department: Computer Science
Description: Studying multimodal ML applications in biomedical science.
FieldOfScience: Computer Science
FieldOfScienceID: '11.0701'
InstitutionID: https://osg-htc.org/iid/p5mk8p3jv6wa
Organization: Saint Louis University
PIName: Tae-Hyuk Ahn
8 changes: 8 additions & 0 deletions projects/UWMadison_Travers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Department: Waisman Center
Description: Study of whole brain white matter development in autistic and non-autistic
children
FieldOfScience: Neuroscience
FieldOfScienceID: '26.1501'
InstitutionID: https://osg-htc.org/iid/fq8thqsj99zh
Organization: University of Wisconsin-Madison
PIName: Brittany Travers
1 change: 1 addition & 0 deletions src/schema/rgsummary.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ID" type="xsd:int" />
<xsd:element name="InstitutionID" type="xsd:string" />
<xsd:element name="Name" type="xsd:string" />
<xsd:element name="IsCCStar" type="boolean" minOccurs="0" />
</xsd:sequence>
Expand Down
Loading

0 comments on commit 3a98c5c

Please sign in to comment.