Add code README and automatic CHANGELOG entries
This commit is contained in:
parent
fbba2d2992
commit
42e706080a
4 changed files with 13 additions and 12 deletions
|
|
@ -1,3 +1,12 @@
|
||||||
All custom code goes into this directory. All scripts should be written such
|
# Popcorn dataset code
|
||||||
that they can be executed from the root of the dataset, and are only using
|
|
||||||
relative paths for portability.
|
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.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import csv
|
import csv
|
||||||
from collections.abc import Generator
|
|
||||||
from datetime import datetime
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -29,7 +27,6 @@ def main(input: str, output: str) -> None:
|
||||||
input_dir = Path(input)
|
input_dir = Path(input)
|
||||||
output_dir = Path(output)
|
output_dir = Path(output)
|
||||||
ensure_dirs(input_dir, output_dir)
|
ensure_dirs(input_dir, output_dir)
|
||||||
|
|
||||||
filesize_csv(input_dir, output_dir)
|
filesize_csv(input_dir, output_dir)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import csv
|
import csv
|
||||||
import json
|
import json
|
||||||
from collections.abc import Generator
|
|
||||||
from datetime import datetime
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, cast
|
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_count = cast(int, data["XuKernel"][entry])
|
||||||
p_date = date
|
p_date = date
|
||||||
writer.writerow([p_date, p_name, p_count])
|
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):
|
def ensure_dirs(input_dir: Path, output_dir: Path):
|
||||||
|
|
@ -46,9 +43,6 @@ def main(input: str, output: str) -> None:
|
||||||
input_dir = Path(input)
|
input_dir = Path(input)
|
||||||
output_dir = Path(output)
|
output_dir = Path(output)
|
||||||
ensure_dirs(input_dir, output_dir)
|
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)
|
package_kernel_csv(input_dir, output_dir)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
1
justfile
1
justfile
|
|
@ -16,3 +16,4 @@ packages:
|
||||||
|
|
||||||
versioned:
|
versioned:
|
||||||
datalad run -m "Create updated output data" -i input/ -o output/ just all
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue