This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Merge PySPConfigBlock back into pyutilib.misc.config #8
Comments
@jsiirola: There are still a few methods on from pyomo.pysp.util.config import PySPConfigBlock
from pyutilib.misc.config import ConfigBlock
#
# Overriding __setattr__
#
print("")
b = PySPConfigBlock(implicit=True)
b.entry_1 = True
print('entry_1' in b) # -> True
print('entry 1' in b) # -> False
b = ConfigBlock(implicit=True)
b.entry_1 = True
print('entry_1' in b) # -> False
print('entry 1' in b) # -> True
#
# Adding __delattr__
#
print("")
b = PySPConfigBlock(implicit=True)
b.entry = True
print('entry' in b) # -> True
del b.entry
print('entry' in b) # -> False
b = ConfigBlock(implicit=True)
b.entry = True
print('entry' in b) # -> True
try:
del b.entry # -> AttributeError
except AttributeError:
print("Caught AttributeError on 'del b.entry'")
#
# Override add
#
print("")
b = PySPConfigBlock(implicit=True)
b.entry = True
print(list(v.name() for v in b.user_values())) # -> ['entry']
b = ConfigBlock(implicit=True)
b.entry = True
print(list(v.name() for v in b.user_values())) # -> [''] |
jsiirola
referenced
this issue
in jsiirola/pyomo
Apr 8, 2021
Report the original (or first seen) key format to the user, but internally store all keys without spaces. The partially fixes #352.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In an effort to simplify / standardize configuration / options in Pyomo, we should ensure that we only use a single configuration management system. The customizations / overrides in
PySPConfigBlock
andPySPConfigValue
should be reviewed and, if appropriate, merged intopyutilib.misc.config
. PySP should then directly use thepyutilib.misc.config
system.The text was updated successfully, but these errors were encountered: