Skip to content

Commit

Permalink
pbtxt -> pb in submission workflow (open-reaction-database#53)
Browse files Browse the repository at this point in the history
* pbtxt -> pb in submission workflow

* update ord-schema version

* remove pbtxt

* Update submission.yml

* Update validation.yml
  • Loading branch information
skearnes authored Feb 8, 2021
1 parent c96a1e6 commit 4728834
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 5,135,284 deletions.
27 changes: 8 additions & 19 deletions .github/workflows/submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name: Submission
on: [pull_request, push]

env:
ORD_SCHEMA_TAG: v0.2.4
ORD_SCHEMA_TAG: v0.2.7

jobs:
count_reactions:
Expand Down Expand Up @@ -129,13 +129,12 @@ jobs:
echo "Found $(wc -l < changed_files.txt | tr -d ' ') changed files"
cat changed_files.txt
# Use `|| (( $? == 1 ))` in case no lines match (exit code is nonzero).
grep -E "\.pbtxt$" changed_files.txt > changed_pbtxt_files.txt || (( $? == 1 ))
grep -E "\.pb$" changed_files.txt > changed_pb_files.txt || (( $? == 1 ))
# Use LOCAL_NUM_CHANGED since ::set-env values are not available immediately.
LOCAL_NUM_CHANGED="$(wc -l < changed_pbtxt_files.txt | tr -d ' ')"
LOCAL_NUM_CHANGED="$(wc -l < changed_pb_files.txt | tr -d ' ')"
echo "NUM_CHANGED_FILES=${LOCAL_NUM_CHANGED}" >> $GITHUB_ENV
echo "Found ${LOCAL_NUM_CHANGED} changed pbtxt files"
cat changed_pbtxt_files.txt
echo "Found ${LOCAL_NUM_CHANGED} changed pb files"
cat changed_pb_files.txt
- name: Install miniconda
uses: s-weigand/setup-conda@v1
with:
Expand All @@ -151,25 +150,15 @@ jobs:
- name: Validate submission
run: |
cd "${GITHUB_WORKSPACE}"
python ./ord-schema/ord_schema/process_dataset.py \
--input_file=changed_pbtxt_files.txt \
python ./ord-schema/ord_schema/scripts/process_dataset.py \
--input_file=changed_pb_files.txt \
--base=upstream/main
if test "$( wc -l < changed_pb_files.txt )" -gt 0; then
python ./ord-schema/ord_schema/process_dataset.py \
--input_file=changed_pb_files.txt
for filename in $(cat changed_pb_files.txt | awk '{print $2}'); do
echo "${filename}"
python ./ord-schema/ord_schema/scripts/check_pb.py \
--pb="${filename}" \
--pbtxt="${filename}txt"
done
fi
if: env.NUM_CHANGED_FILES != '0'
- name: Update submission
run: |
cd "${GITHUB_WORKSPACE}"
python ./ord-schema/ord_schema/process_dataset.py \
--input_file=changed_pbtxt_files.txt \
python ./ord-schema/ord_schema/scripts/process_dataset.py \
--input_file=changed_pb_files.txt \
--update \
--cleanup \
--base=upstream/main \
Expand Down
20 changes: 3 additions & 17 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
- '.github/workflows/validation.yml'

env:
ORD_SCHEMA_TAG: v0.2.4
ORD_SCHEMA_TAG: v0.2.7

jobs:
validate_database:
Expand All @@ -39,22 +39,8 @@ jobs:
pip install -r requirements.txt
conda install -c rdkit rdkit
python setup.py install
- name: Validate *.pbtxt datasets
- name: Validate datasets
run: |
cd "${GITHUB_WORKSPACE}"
python ./ord-schema/ord_schema/process_dataset.py \
--input_pattern="data/*/*.pbtxt"
- name: Validate *.pb datasets
run: |
cd "${GITHUB_WORKSPACE}"
python ./ord-schema/ord_schema/process_dataset.py \
python ./ord-schema/ord_schema/scripts/process_dataset.py \
--input_pattern="data/*/*.pb"
- name: Check pbtxt <-> pb encoding
run: |
cd "${GITHUB_WORKSPACE}"
for filename in data/*/*.pb; do
echo "${filename}"
python ./ord-schema/ord_schema/scripts/check_pb.py \
--pb="${filename}" \
--pbtxt="${filename}txt"
done
Loading

0 comments on commit 4728834

Please sign in to comment.