Skip to content

Commit

Permalink
242 create gh actions to generate machine readable codes (#256)
Browse files Browse the repository at this point in the history
* first try to create action for github actions

* install the missing deps dictoxml

* sudo

* xml,txt files

* Fix push

Add permissions to push

* xml,txt files

* push only on push

* xml,txt files

---------

Co-authored-by: antoineMerleEUM <[email protected]>
Co-authored-by: Enrico Fucile <[email protected]>
  • Loading branch information
3 people authored Jun 4, 2024
1 parent 42f6590 commit e8b5cec
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 8 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on: [ push ]

permissions:
contents: write

jobs:
make_xml:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: create xml files and push
run: |
sudo apt-get install -y python3-pip
pip3 install dicttoxml
python3 scripts/create_master_lists.py
ls xml
git config --global user.email "[email protected]"
git config --global user.name "Enrico Fucile"
git branch
# Use of status --pocelain to check if files have been changed or not
# If changes commit and push
if [[ `git status --porcelain` ]]; then
git add .
git commit -m "xml,txt files" -a
git push
# if not, only print a message saying not commit
else
echo "No changes to commit"
fi
6 changes: 3 additions & 3 deletions txt/Template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3656,9 +3656,9 @@ Product definition template 4.124 - Analysis or forecast at a horizontal level o
"Product definition template 4.127 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides",54,Type of second fixed surface,(see Code table 4.5),,4.5,,Operational
"Product definition template 4.127 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides",55,Scale factor of second fixed surface,,,,,Operational
"Product definition template 4.127 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides",56-59,Scaled value of second fixed surface,,,,,Operational
"Product definition template 4.127 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides",60,Type of ensemble forecast,(See Code table 4.6),,4.6,,
"Product definition template 4.127 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides",61,Perturbation Number,,,,,
"Product definition template 4.127 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides",62,Number of forecasts in ensemble,,,,,
"Product definition template 4.127 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides",60,Type of ensemble forecast,(See Code table 4.6),,4.6,,Operational
"Product definition template 4.127 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides",61,Perturbation Number,,,,,Operational
"Product definition template 4.127 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides",62,Number of forecasts in ensemble,,,,,Operational
"Product definition template 4.127 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides",63-64,Year of end of overall time interval,,,,,Operational
"Product definition template 4.127 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides",65,Month of end of overall time interval,,,,,Operational
"Product definition template 4.127 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides",66,Day of end of overall time interval,,,,,Operational
Expand Down
2 changes: 1 addition & 1 deletion xml/CodeFlag.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" generated="2024-04-22T12:29:48.963481">
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" generated="2024-06-04T10:10:59.318400">
<GRIB2_CodeFlag_en>
<Title_en>Code table 0.0 - Discipline of processed data in the GRIB message, number of GRIB Master table</Title_en>
<CodeFlag>0</CodeFlag>
Expand Down
8 changes: 4 additions & 4 deletions xml/Template.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" generated="2024-04-22T12:29:48.963481">
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" generated="2024-06-04T10:10:59.318400">
<GRIB2_Template_en>
<Title_en>Identification template 1.0 - calendar definition</Title_en>
<OctetNo>24</OctetNo>
Expand Down Expand Up @@ -36578,7 +36578,7 @@
<noteIDs/>
<codeTable>4.6</codeTable>
<flagTable/>
<Status/>
<Status>Operational</Status>
</GRIB2_Template_en>
<GRIB2_Template_en>
<Title_en>Product definition template 4.127 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides</Title_en>
Expand All @@ -36588,7 +36588,7 @@
<noteIDs/>
<codeTable/>
<flagTable/>
<Status/>
<Status>Operational</Status>
</GRIB2_Template_en>
<GRIB2_Template_en>
<Title_en>Product definition template 4.127 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides</Title_en>
Expand All @@ -36598,7 +36598,7 @@
<noteIDs/>
<codeTable/>
<flagTable/>
<Status/>
<Status>Operational</Status>
</GRIB2_Template_en>
<GRIB2_Template_en>
<Title_en>Product definition template 4.127 - Individual ensemble forecast, control and perturbed, at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval for radionuclides</Title_en>
Expand Down

0 comments on commit e8b5cec

Please sign in to comment.