Skip to content

Restructuring init.py & input.py #4719

Open
Open

Description

@clmould

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 #4523 (review)

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 #4523 (comment)

Activity

  1. self-assigned this
    on Oct 29, 2026
  2. added theissue type on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions