Skip to content

Commit

Permalink
Minor refactoring (#68)
Browse files Browse the repository at this point in the history
* rename folder

* fix descriptions

* fix gh action

* update readme
  • Loading branch information
rcannood authored Jun 6, 2024
1 parent 503eb6d commit 33a2752
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 22 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ on:
branches: [ 'main' ]
workflow_dispatch:
inputs:
target_branch:
description: 'Branch to deploy to. If not specified, `build/${BRANCH_NAME}` will be used.'
required: false
version:
description: 'Version name to use for the build. If not specified, `${BRANCH_NAME}_build` will be used.'
description: 'Version name to use for the build. If not specified, `build/${BRANCH_NAME}` will be used.'
required: false

jobs:
Expand All @@ -15,7 +18,8 @@ jobs:
runs-on: ubuntu-latest

outputs:
version: ${{ steps.version.outputs.version }}
target_branch: ${{ steps.defaults.outputs.target_branch }}
version: ${{ steps.defaults.outputs.version }}
component_matrix: ${{ steps.set_matrix.outputs.matrix }}

steps:
Expand All @@ -24,13 +28,21 @@ jobs:
- uses: viash-io/viash-actions/setup@v5

- name: Determine version tag from branch name
id: version
id: defaults
run: |
if [ -z "$INPUT_VERSION" ]; then
echo "version=$(echo $GITHUB_REF | sed 's/refs\/heads\/\(.*\)/\1_build/')" >> $GITHUB_OUTPUT
else
echo "version=$INPUT_VERSION" >> $GITHUB_OUTPUT
BRANCH_NAME=$(echo $GITHUB_REF | sed 's/refs\/heads\///')
VERSION=${{ github.event.inputs.version }}
if [ -z "$VERSION" ]; then
VERSION="build/$BRANCH_NAME"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
TARGET_BRANCH=${{ github.event.inputs.target_branch }}
if [ -z "$TARGET_BRANCH" ]; then
TARGET_BRANCH="build/$BRANCH_NAME"
fi
echo "target_branch=$TARGET_BRANCH" >> $GITHUB_OUTPUT
- name: Remove target folder from .gitignore
run: |
Expand All @@ -39,15 +51,15 @@ jobs:
- uses: viash-io/viash-actions/ns-build@v5
with:
config_mod: .functionality.version := '${{ steps.version.outputs.version }}'
config_mod: .functionality.version := '${{ steps.defaults.outputs.version }}'
parallel: true

- name: Deploy to target branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .
publish_branch: ${{ steps.version.outputs.version }}
publish_branch: ${{ steps.defaults.outputs.target_branch }}

- id: ns_list
uses: viash-io/viash-actions/ns-list@v5
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,12 @@ Arguments:

</div>


## Component type: Method

Path:
[`src/methods`](https://github.com/openproblems-bio/openproblems-v2/tree/main/src/methods)

A regression method.
A perturbation prediction method

Arguments:

Expand All @@ -406,7 +405,7 @@ Arguments:
Path:
[`src/metrics`](https://github.com/openproblems-bio/openproblems-v2/tree/main/src/metrics)

A metric to compare two predictions.
A perturbation prediction metric

Arguments:

Expand Down
2 changes: 1 addition & 1 deletion src/api/comp_control_method.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ functionality:
label: Control Method
summary: A control method.
description: |
A control method to predict perturbation effects.
A control method to serve as a quality control for the perturbation prediction benchmark.
arguments:
- name: --de_train_h5ad
__merge__: file_de_train_h5ad.yaml
Expand Down
2 changes: 1 addition & 1 deletion src/api/comp_method.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__merge__: comp_method_notest.yaml
__merge__: wf_method.yaml
functionality:
test_resources:
- type: python_script
Expand Down
4 changes: 2 additions & 2 deletions src/api/comp_metric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ functionality:
type: metric
type_info:
label: Metric
summary: A metric to compare two predictions.
summary: A perturbation prediction metric
description: |
A metric to compare two predictions.
A metric to compare a perturbation prediction to the ground truth.
arguments:
- name: --de_test_h5ad
__merge__: file_de_test_h5ad.yaml
Expand Down
4 changes: 2 additions & 2 deletions src/api/comp_method_notest.yaml → src/api/wf_method.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ functionality:
type: method
type_info:
label: Method
summary: A regression method.
summary: A perturbation prediction method
description: |
A regression method to predict the expression of one modality from another.
A method for predicting the perturbation response of small molecules on certain cell types.
arguments:
- name: --de_train_h5ad
__merge__: file_de_train_h5ad.yaml
Expand Down
2 changes: 1 addition & 1 deletion src/methods/lgc_ensemble/config.vsh.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__merge__: ../../api/comp_method_notest.yaml
__merge__: ../../api/wf_method.yaml

functionality:
name: lgc_ensemble
Expand Down
4 changes: 2 additions & 2 deletions src/process_dataset/bootstrap/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ functionality:
type: process_dataset
type_info:
label: Bootstrap
summary: A component to generate bootstraps of a dataset.
summary: Bootstrap a dataset
description: |
This component generates bootstraps of a dataset. It takes as input a parquet file and an h5ad file and generates bootstraps of the dataset. The bootstraps are saved as parquet and h5ad files.
This component bootstraps a dataset.
argument_groups:
- name: Inputs
arguments:
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/process_dataset/run_limma/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ functionality:
label: Limma
summary: Run limma
description: |
Run limma for the parturbation regression task.
Run limma for the perturbation regression task.
arguments:
- name: --input
type: file
Expand Down

0 comments on commit 33a2752

Please sign in to comment.