Open-source Python companion for TIMES workflows (early release, feedback welcome)
#1
Dear TIMES community,
I’d like to share an early open-source project I built: times-data
https://github.com/MMobir/times-data
The main motivation is simple: I enjoy Python-first workflows and wanted a scriptable, transparent, version-control-friendly data layer for TIMES modeling.
A few points to be fully clear:
* This is complementary to established TIMES workflows and tools.
* This is not a UI product (yet) — it is currently Python + CLI.
* It is open source (MIT) and intended to stay open source.
times-data currently supports two entry paths:
1. Build from scratch in Python, or
2. Import existing DD files and edit/validate/re-export.
Current capabilities include:
* typed model graph (commodities/processes/parameters)
* schema + structural validation
* DD export/compile for standard TIMES/GAMS runs
Verification so far:
* tested on all 12 official DemoS models
* on models within my active GAMS community license limits, round-trip tests gave exact objective value matches
* larger demos compile successfully but exceed solve-size limits in my current license environment
I’m using this experimentally in my own global model workflow at Rhodium Group, and I’d really value community testing and feedback.
If there is interest, I’m happy to record a short walkthrough video showing:
* build-from-scratch path
* DD import/edit/re-export path
* validation and solve flow
Issues, criticism, and contributions are all welcome:
https://github.com/MMobir/times-data
Best,
Mahmoud Mobir
Reply
#2
Great initiative Mahmoud!
Reply
#3
I downloaded the code, ran the "pip install ..." command (seemed ok), and then tried the test command suggested:

> pytest tests/ -v

The result was:
'pytest' is not recognized as an internal or external command, operable program or batch file.

So, the instructions given (or the dependencies management) are apparently not meant for beginners.  Big Grin
Reply
#4
Thanks Antti — really appreciate you trying it so quickly and reporting this.

You were absolutely right: the previous README test command could fail on some setups when pytest is not on PATH.

I have now updated the docs to make this robust for beginners and Windows users:

py -m pip install -e ".[dev]"
py -m pytest tests/ -v
(and python3 -m ... equivalents for Mac/Linux), plus fallback instructions if times-data is not found on PATH.

I also added a short post-install sanity check to verify the CLI works immediately.

Thanks again
Reply
#5
Nice! Had a quick read through readme - looks like it can have potential synergies with xl2times.:-)
Reply
#6
(18-04-2026, 09:26 AM)Olexandr Wrote: Nice! Had a quick read through readme - looks like it can have potential synergies with xl2times.:-)

I've now got copilot to analyse potential synergies between times-data and xl2times. They are documented here: https://github.com/etsap-TIMES/xl2times/...ability.md

From my point of view, this looks promising!
Reply
#7
Thanks Olexandr — really appreciate this.

For now I want to keep focus strictly on shipping and usability of times-data:

- make install/test/docs friction-free across Windows/Mac/Linux
- keep DD import/edit/validate/re-export stable
- keep Demo-model verification reproducible and easy to run
- publish frequent small releases and fix issues quickly
- So my immediate priority is practical reliability for users, not architecture discussions.
If people find it useful in day-to-day modeling, we can expand from there.
Reply
#8
Sure! What I meant is that we can probably enable the possibility of passing the data from xl2times on to times-data. This was working with a times model using times-data can stay entirely programmatic (i.e. without the need to generate .dd files). I'll tag you on github for any feedback whenever that part is ready.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)