Restructuring init.py & input.py

Abierto
#4,719 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@clmould ya está trabajando en esto.

Desde el 29/10/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Looks good just the one structural comment. I think we can go further to collating some of these thing under one wrapper.
Move the init.py file into the core/data_structure folder I think. The contents of that file is 90% the check_process. I would rename the file to check_input.py. The other functions in that file can go onto the DataStructure object in data_structure/base.py except for get_git_summary which I would put in as a standalone function in the file. In my head the check_process function will eventually disappear as the validation moves onto the individual data structure objects. Right now we should just isolate it.

All of the functions in input.py can also move to the data structure. I would leave InputVariable and the associated dictionary where it is

Originally posted by @je-cook in https://github.com/ukaea/PROCESS/pull/4523#pullrequestreview-5694990882

It feels like all of these should be methods on the data structure as they all only take it as input.

data.parse_input_file(in_dat)
data.set_active_constraints()
data.set_device_type()
data.check_process()
data.run_summary() # maybe rename, its not running anything, suggestion "write_outfile_header"

you could also combine them into one call of data.setup(in_dat) or similar. Or even data.setup(InDat(filename=data.globals.fileprefix, update_obsolete=update_obsolete)) you could maybe do away with this whole function entirely if we do that. So you would just call some data.setup in initiailse

Originally posted by @je-cook in https://github.com/ukaea/PROCESS/pull/4523#discussion_r4410290399

Lenguaje dominante
Python
Estrellas
75
Forks
29
Merge medio
3 d 3 h
PR fusionados (30 d)
40

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ukaea/PROCESS

Todos los issues de ukaea/PROCESS

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.