edbennett / glue_analysis

MIT License
0 stars 1 forks source link

Default values vs. undefined #16

Open chillenzer opened 1 year ago

chillenzer commented 1 year ago

I think not setting default values anymore might have broken some of the consistency checks that you implemented. We should come back and check this.

chillenzer commented 1 year ago

We might want to consider this again. I don't think an undefined variable is a good choice here.

edbennett commented 1 year ago

Can you point me at specific things that are undefined (and may now be inconsistent) now please?

chillenzer commented 1 year ago

Well, by default almost everything. Only filename is necessary (no idea why) and ensemble_name is optional with a default (and _frozen=False). So, the simplest case would be

CorrelatorEnsemble('filename.txt')

which has _correlators, _vevs, metadata undefined.

edbennett commented 1 year ago

Ah, I see. It's not unprecedented for libraries to strongly recommend avoiding using the default constructor and instead to recommend higher-level helper functions that call the constructor—e.g. "Arrays should be constructed using array, zeros or empty (refer to the See Also section below). The parameters given here refer to a low-level method (ndarray(…)) for instantiating an array"