Add code README and automatic CHANGELOG entries

This commit is contained in:
Marty Oehme 2025-09-30 21:39:22 +02:00
parent fbba2d2992
commit 42e706080a
Signed by: Marty
GPG key ID: 4E535BC19C61886E
4 changed files with 13 additions and 12 deletions

View file

@ -1,3 +1,12 @@
All custom code goes into this directory. All scripts should be written such
that they can be executed from the root of the dataset, and are only using
relative paths for portability.
# Popcorn dataset code
Each script can be run stand-alone like `python code/files.py <input-dir> <output-dir>`,
exchanging the script file for the one intended.
It is suggested, however, to run the scripts using the `just` command runner from the
dataset root, such as `just files` for the same effect as above.
This will automatically populate the correct input and output directories.
To create new `datalad` versioned output data, run `just versioned` or `just` without any arguments.
A new commit containing the updated data will be created,
and an automatic entry in the CHANGELOG made.

View file

@ -1,6 +1,4 @@
import csv
from collections.abc import Generator
from datetime import datetime
from pathlib import Path
@ -29,7 +27,6 @@ def main(input: str, output: str) -> None:
input_dir = Path(input)
output_dir = Path(output)
ensure_dirs(input_dir, output_dir)
filesize_csv(input_dir, output_dir)

View file

@ -1,7 +1,5 @@
import csv
import json
from collections.abc import Generator
from datetime import datetime
from pathlib import Path
from typing import Any, cast
@ -33,7 +31,6 @@ def package_kernel_csv(input_dir: Path, output_dir: Path) -> None:
p_count = cast(int, data["XuKernel"][entry])
p_date = date
writer.writerow([p_date, p_name, p_count])
# print(output_file, p_date, p_name, p_count)
def ensure_dirs(input_dir: Path, output_dir: Path):
@ -46,9 +43,6 @@ def main(input: str, output: str) -> None:
input_dir = Path(input)
output_dir = Path(output)
ensure_dirs(input_dir, output_dir)
# json_to_daily_pkg(Path(input) / "daily", Path(output) / "daily", force=True)
# json_to_unique_csv(Path(input) / "daily", Path(output), force=True)
package_kernel_csv(input_dir, output_dir)

View file

@ -16,3 +16,4 @@ packages:
versioned:
datalad run -m "Create updated output data" -i input/ -o output/ just all
printf "\n## %s\n\n- auto generated\n" $(date +%F) | sed -i '/CHANGELOG/r /dev/stdin' CHANGELOG.md