I think Guild is not recognizing the flags and scalars because they’re happening inside the class and function calls. Is there a way for Guild to parse them without modifying the code?
Guild does not look into class defs or function defs for scalars by design. Guild supports quite a few standard interfaces to Python modules:
Global vars including top-level variables, global dicts, and global simple objects
Argparse and click
Config files
I would encourage you to define your input params outside class defs and functions and refer to them as needed. This is a good separation for your code — script inputs ought IMO to be clearly defined.
The best way I think is to define a set of command line args to the script (e.g. via argparse or click). This not only clearly designates the script interface, it lets you easily modify params whenever you run the script. This is Guild’s default interface for that reason.
The easiest from a coding standpoint is to just use global variables. If you have a lot of params, use a single global dict or simple object. This example shows the various approaches.