9 Commits

Author SHA1 Message Date
88b75e3e62 Add additional codes, 4601 & 6594
All checks were successful
Generate Release / validate_and_release (push) Successful in 4s
2026-04-02 11:20:50 +01:00
a241b992ac Add future considerations
All checks were successful
Generate Release / validate_and_release (push) Successful in 6s
2026-03-19 06:35:11 +00:00
5722e5b631 Update README.md
All checks were successful
Generate Release / validate_and_release (push) Successful in 7s
2026-03-18 19:24:05 +00:00
eac8d71613 Force new PIS Generation
All checks were successful
Generate Release / validate_and_release (push) Successful in 8s
2026-03-02 23:07:36 +00:00
f08a579246 Add semi-colons to match personal code style
All checks were successful
Generate Release / validate_and_release (push) Successful in 8s
2026-02-21 19:43:17 +00:00
adb538cbc4 Fix JSONL inclusion?
All checks were successful
Generate Release / validate_and_release (push) Successful in 6s
2026-01-03 23:42:06 +00:00
d00eb5cf6c Try fix included files again
All checks were successful
Generate Release / validate_and_release (push) Successful in 6s
2026-01-03 23:39:28 +00:00
247a997353 Fix path to JSONL
All checks were successful
Generate Release / validate_and_release (push) Successful in 5s
2026-01-03 23:38:24 +00:00
cc14397588 Fix YAML Parsing in jsonl generator
All checks were successful
Generate Release / validate_and_release (push) Successful in 5s
2026-01-03 23:36:43 +00:00
6 changed files with 41 additions and 15 deletions

View File

@@ -33,6 +33,7 @@ jobs:
exit 1
fi
echo "File verified"
pwd
- name: Create Release
if: success()
@@ -44,5 +45,5 @@ jobs:
tag_name: ${{ steps.timestamp.outputs.date }}
name: ${{ steps.timestamp.outputs.date }}
token: ${{ secrets.OWLBOT_KEY }}
files: |
release-data.jsonl
files: |-
pis-objects.jsonl

View File

@@ -3,3 +3,24 @@
APIS Codes for GWR Class 150, 158 & 16x units
Re-initialised in a new repository on 04/12/2025. This decision was made to keep one data type, in one repository to maintain separation of data-ingress services in preparation for the 2026 data-ingress project.
Data is prepared for the data-ingress service using Gitea actions, any changes made to the actions require care to ensure it doesn't break the ingress of data to OwlBoard.
## Making Changes
Updates should be made in a branch following the naming pattern:
```
branches:
- auto-*
- pis-*
```
Updated should be placed in to a new file in the /pis/ directory.
Code deletions must be made in the 'main' branch.
## Future Considerations
Adding traction type field to cover 80x generic headcodes, and whatever 175's use if not the same as other units.

View File

@@ -1,4 +1,8 @@
pis:
- code: "4601"
stops: [cdf,nwp,stj,fit,bri,bth,boa,tro,wsb,wmn,sal,rom,sou,frm]
- code: "6594"
stops: [gcr,yae,bpw,fit,asd,srd,lwh,bri]
- code: "0106"
stops: [slo,wnc]
toc: "gw"

View File

@@ -1,7 +1,7 @@
const fs = require('fs')
const yaml = require('yaml')
const fs = require('fs');
const yaml = require('yaml');
const directoryPath = './pis/'
const directoryPath = './pis/';
function sortAndMergeYAMLFiles() {
try {
@@ -12,15 +12,15 @@ function sortAndMergeYAMLFiles() {
files.forEach(file => {
const data = fs.readFileSync(directoryPath + file, 'utf-8');
const parsedData = yaml.parse(data)
const parsedData = yaml.parse(data);
if (parsedData && typeof parsedData === 'object' && parsedData.pis) {
mergedData.push(...parsedData.pis)
mergedData.push(...parsedData.pis);
} else {
if (Array.isArray(parsedData)) {
mergedData.push(...parsedData);
} else {
console.error("Incorrect YAML")
console.error("Incorrect YAML");
}
}
});
@@ -29,7 +29,7 @@ function sortAndMergeYAMLFiles() {
const codeA = parseInt(a.code);
const codeB = parseInt(b.code);
return codeA - codeB
})
});
@@ -46,9 +46,9 @@ function sortAndMergeYAMLFiles() {
try {
fs.writeFileSync('./pis/codes.yaml', outputString);
console.log("Overwritten codes.yaml")
console.log("Overwritten codes.yaml");
} catch (err) {
console.error("Error writing codes.yaml", err)
console.error("Error writing codes.yaml", err);
}
// Remove any new files
@@ -60,7 +60,7 @@ function sortAndMergeYAMLFiles() {
});
} catch(err) {
console.error('Error merging YAML:', err)
console.error('Error merging YAML:', err);
}
}

View File

@@ -11,7 +11,7 @@ if (!inputFile) {
try {
const fileContent = fs.readFileSync(inputFile, 'utf8');
const data = yaml.loadAll(fileContent);
const data = yaml.parse(fileContent);
if (!data || !data.pis || !Array.isArray(data.pis)) {
throw new Error('Invalid structure: Expected object with "pis" array.');