-
Notifications
You must be signed in to change notification settings - Fork 0
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 #6 from NIEHS/develop
Set up main with basic actions, skeleton
- Loading branch information
Showing
30 changed files
with
990 additions
and
2 deletions.
There are no files selected for viewing
Empty file.
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,43 @@ | ||
--- | ||
name: CI/CD | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
- feature/** | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: psf/black@stable | ||
with: | ||
options: "--check --verbose" | ||
src: "./accelerator_core" | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.10" ] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Test with pytest | ||
run: | | ||
coverage run -m pytest -v -s | ||
- name: Generate Coverage Report | ||
run: | | ||
coverage report -m |
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 |
---|---|---|
|
@@ -169,3 +169,6 @@ cython_debug/ | |
|
||
# PyPI configuration file | ||
.pypirc | ||
|
||
.idea | ||
.DS_Store |
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,15 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- repo: https://github.com/psf/black | ||
rev: 25.1.0 | ||
hooks: | ||
- id: black | ||
language_version: python3.11 |
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
Empty file.
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,29 @@ | ||
from accelerator_core.crosswalk import Crosswalk | ||
|
||
|
||
class Accession: | ||
"""Handles validation and CRUD operations for metadata records.""" | ||
|
||
def __init__(self, data: dict): | ||
"""Initialize Accession with validated data.""" | ||
self.data = data | ||
|
||
def validate(self) -> bool: | ||
"""Validate JSON output from Crosswalk.""" | ||
pass | ||
|
||
def create(self) -> str: | ||
"""Create a new record in the database.""" | ||
pass | ||
|
||
def read(self, record_id: str) -> dict: | ||
"""Retrieve a record from the database.""" | ||
pass | ||
|
||
def update(self, record_id: str, new_data: dict) -> bool: | ||
"""Update an existing record.""" | ||
pass | ||
|
||
def delete(self, record_id: str) -> bool: | ||
"""Delete a record from the database.""" | ||
pass |
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,10 @@ | ||
from abc import ABC, abstractmethod | ||
|
||
|
||
class Crosswalk(ABC): | ||
"""Abstract superclass for mapping raw data to a structured JSON format.""" | ||
|
||
@abstractmethod | ||
def transform(self, raw_data: dict) -> dict: | ||
"""Convert raw data into a standardized format.""" | ||
pass |
Empty file.
Empty file.
Empty file.
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,18 @@ | ||
class Dissemination: | ||
"""Retrieves data from the database and transforms it into a JSON document for endpoint systems.""" | ||
|
||
def __init__(self, record_id: str): | ||
"""Initialize Dissemination with a record ID.""" | ||
self.record_id = record_id | ||
|
||
def fetch_data(self) -> dict: | ||
"""Retrieve data from the database.""" | ||
pass | ||
|
||
def format_for_endpoint(self, system: str) -> dict: | ||
"""Convert data into a format required by a specific endpoint (CHORDS, Navigator, CEDAR).""" | ||
pass | ||
|
||
def export(self, system: str) -> bool: | ||
"""Send the formatted data to the respective system.""" | ||
pass |
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,12 @@ | ||
# Accelerator Data Model | ||
## Version: 0.0.1-alpha | ||
|
||
## Description | ||
|
||
This accel.json file, and the accompanying JSON schema, represent the core data model for Accelerator. | ||
|
||
|
||
## Development process | ||
|
||
The initial accel.json file is derived from the Excel model of the 1.5 CHORDS model | ||
found here: https://nih.sharepoint.com/:f:/r/sites/NIH-DataAcceleratorProgram/Shared%20Documents/General/Design/term%20mappings?csf=1&web=1&e=1JTZT1 |
Empty file.
Oops, something went wrong.