mirror of
https://github.com/PR0M3TH3AN/python_charts.git
synced 2026-10-27 08:50:39 +00:00
Update AGENTS.md with guidance on running scripts in offline environments
- Clarify that `refresh_data.py` should not be run in Codex/CI due to lack of internet access. - Emphasize the need for local data in `data/fred.db` before executing scripts. - Adjust descriptions for `startup.sh` and `Makefile` to reflect changes in usage and requirements.
This commit is contained in:
1 parent
a1cf3c888a
commit
c6a54e8121
1 file changed
+14
-9
@@ -1,19 +1,21 @@
|
||||
# AGENTS.md — Guidance for OpenAI Codex
|
||||
|
||||
## Execution Commands
|
||||
- **Always** invoke Python scripts via the startup wrapper, which now installs dependencies globally and then runs your code under the system Python:
|
||||
- **Always** invoke Python scripts via the startup wrapper, which installs dependencies globally and then runs your code under the system Python:
|
||||
|
||||
```bash
|
||||
./startup.sh --offset <months> --end <YYYY-MM-DD> --extend-years <N>
|
||||
````
|
||||
|
||||
* **Never** call `refresh_data.py` from within a Task Command. This environment has **no internet access**, so attempts to fetch external data will fail. Data in `data/fred.db` must already be present.
|
||||
|
||||
## Project Overview
|
||||
|
||||
This repository, **python\_charts**, provides a framework for fetching economic time series from FRED, storing them locally, and producing custom matplotlib charts with configurable parameters. The core components are:
|
||||
|
||||
* **`startup.sh`**: Single‐entrypoint script to install dependencies globally, fetch data, and run specified commands under system Python.
|
||||
* **`startup.sh`**: Single‐entrypoint script to install dependencies globally, ensure local data is present, and run specified commands under system Python.
|
||||
* **`Makefile`**: Convenient high‐level targets (`install`, `data`, `plot`, `plot‐custom`, `test`, `clean`) that funnel through `startup.sh` for reproducible builds.
|
||||
* **`scripts/refresh_data.py`**: Downloads UNRATE and DCOILWTICO series into `data/fred.db`.
|
||||
* **`scripts/refresh_data.py`**: Downloads UNRATE and DCOILWTICO series into `data/fred.db`—**only run in an internet-connected environment**, not in Codex/CI.
|
||||
* **`scripts/lagged_oil_unrate_chart_styled.py`**: Generates the lagged oil vs. unemployment chart with fixed axes styling and log scale.
|
||||
|
||||
Future extensions will add additional custom chart scripts under `scripts/`, all driven by the same bootstrapping and command conventions.
|
||||
@@ -36,11 +38,14 @@ Future extensions will add additional custom chart scripts under `scripts/`, all
|
||||
./startup.sh --offset 12 --end 2025-05-31 --extend-years 5
|
||||
```
|
||||
|
||||
* **Data refresh**:
|
||||
* **Data refresh (offline environments)**:
|
||||
|
||||
```bash
|
||||
./startup.sh scripts/refresh_data.py
|
||||
```
|
||||
* **Do not** run `refresh_data.py` in Codex/CI — data must already be in `data/fred.db`.
|
||||
* To update data in an internet-connected shell, run:
|
||||
|
||||
```bash
|
||||
python scripts/refresh_data.py
|
||||
```
|
||||
|
||||
* **Run tests**:
|
||||
|
||||
@@ -58,7 +63,7 @@ Future extensions will add additional custom chart scripts under `scripts/`, all
|
||||
|
||||
* **Python**: Target version ≥ 3.8. Use type hints for all function signatures. Follow PEP8 with Black formatting.
|
||||
* **Bash**: `startup.sh` uses `set -euo pipefail`.
|
||||
* **Makefile**: Use tab‐indented commands. All targets should funnel through `startup.sh`.
|
||||
* **Makefile**: Use tab-indented commands. All targets should funnel through `startup.sh`.
|
||||
|
||||
## Testing & Validation
|
||||
|
||||
@@ -89,4 +94,4 @@ Future extensions will add additional custom chart scripts under `scripts/`, all
|
||||
./startup.sh --offset 18
|
||||
```
|
||||
|
||||
*End of AGENTS.md — tailored for python\_charts repo*
|
||||
*End of AGENTS.md — tailored for python\_charts repo*
|
||||
Reference in new issue
Block a user