Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: pex_config
-
Labels:None
-
Story Points:2
-
Epic Link:
-
Team:Alert Production
Description
...or just similar field names, I suppose. Viz:
In [1]: import lsst.pex.config as pexConfig |
|
In [2]: class SuperConfig(pexConfig.Config): |
...: foo = pexConfig.Field(doc="test", dtype=str) |
...:
|
|
In [3]: class SubConfig(SuperConfig): |
...: bar = pexConfig.Field(doc="test", dtype=str) |
...:
|
|
In [4]: super_c, sub_c = SuperConfig(), SubConfig() |
|
In [5]: pexConfig.compareConfigs("", super_c, sub_c) |
Out[5]: True |
|
In [6]: pexConfig.compareConfigs("", sub_c, super_c) |
--------------------------------------------------------------------------- |
AttributeError Traceback (most recent call last)
|
<ipython-input-7-e502e8e334d3> in <module>() |
----> 1 pexConfig.compareConfigs("", sub_c, super_c) |
|
/software/lsstsw/stack_20181012/stack/miniconda3-4.5.4-fcd27eb/Linux64/pex_config/16.0-7-g9645df7+1/python/lsst/pex/config/comparison.py in compareConfigs(name, c1, c2, shortcut, rtol, atol, output) |
101 equal = True |
102 for field in c1._fields.values(): |
--> 103 result = field._compare(c1, c2, shortcut=shortcut, rtol=rtol, atol=atol, output=output) |
104 if not result and shortcut: |
105 return False |
|
/software/lsstsw/stack_20181012/stack/miniconda3-4.5.4-fcd27eb/Linux64/pex_config/16.0-7-g9645df7+1/python/lsst/pex/config/config.py in _compare(self, instance1, instance2, shortcut, rtol, atol, output) |
356 """ |
357 v1 = getattr(instance1, self.name) |
--> 358 v2 = getattr(instance2, self.name) |
359 name = getComparisonName( |
360 _joinNamePath(instance1._name, self.name), |
|
AttributeError: 'SuperConfig' object has no attribute 'bar' |
Both of these comparisons are mistakes: the configs aren't equal, so shouldn't return as if they are (in the first case), and the comparison should certainly not raise.
Attachments
Issue Links
- is duplicated by
-
DM-11707 Comparing configs after retargeting a subtask throws an exception
- Invalid
Activity
Field | Original Value | New Value |
---|---|---|
Epic Link |
|
Status | To Do [ 10001 ] | In Progress [ 3 ] |
Description |
...or just similar field names, I suppose. Viz:
{code:python} In [1]: import lsst.pex.config as pexConfig In [2]: class SuperConfig(pexConfig.Config): ...: foo = pexConfig.Field(doc="test", dtype=str) ...: In [3]: class SubConfig(SuperConfig): ...: bar = pexConfig.Field(doc="test", dtype=str) ...: In [4]: super_c, sub_c = SuperConfig(), SubConfig() In [5]: pexConfig.compareConfigs("", super_c, sub_c) Out[5]: True In [6]: pexConfig.compareConfigs("", sub_c, super_c) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-7-e502e8e334d3> in <module>() ----> 1 pexConfig.compareConfigs("", sub_c, super_c) /software/lsstsw/stack_20181012/stack/miniconda3-4.5.4-fcd27eb/Linux64/pex_config/16.0-7-g9645df7+1/python/lsst/pex/config/comparison.py in compareConfigs(name, c1, c2, shortcut, rtol, atol, output) 101 equal = True 102 for field in c1._fields.values(): --> 103 result = field._compare(c1, c2, shortcut=shortcut, rtol=rtol, atol=atol, output=output) 104 if not result and shortcut: 105 return False /software/lsstsw/stack_20181012/stack/miniconda3-4.5.4-fcd27eb/Linux64/pex_config/16.0-7-g9645df7+1/python/lsst/pex/config/config.py in _compare(self, instance1, instance2, shortcut, rtol, atol, output) 356 """ 357 v1 = getattr(instance1, self.name) --> 358 v2 = getattr(instance2, self.name) 359 name = getComparisonName( 360 _joinNamePath(instance1._name, self.name), AttributeError: 'SuperConfig' object has no attribute 'bar' {code} *Both* of these comparisons are mistakes: the comparisons aren't equal, so shouldn't return as if they are (in the first case), and the comparison should certainly not raise. |
...or just similar field names, I suppose. Viz:
{code:python} In [1]: import lsst.pex.config as pexConfig In [2]: class SuperConfig(pexConfig.Config): ...: foo = pexConfig.Field(doc="test", dtype=str) ...: In [3]: class SubConfig(SuperConfig): ...: bar = pexConfig.Field(doc="test", dtype=str) ...: In [4]: super_c, sub_c = SuperConfig(), SubConfig() In [5]: pexConfig.compareConfigs("", super_c, sub_c) Out[5]: True In [6]: pexConfig.compareConfigs("", sub_c, super_c) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-7-e502e8e334d3> in <module>() ----> 1 pexConfig.compareConfigs("", sub_c, super_c) /software/lsstsw/stack_20181012/stack/miniconda3-4.5.4-fcd27eb/Linux64/pex_config/16.0-7-g9645df7+1/python/lsst/pex/config/comparison.py in compareConfigs(name, c1, c2, shortcut, rtol, atol, output) 101 equal = True 102 for field in c1._fields.values(): --> 103 result = field._compare(c1, c2, shortcut=shortcut, rtol=rtol, atol=atol, output=output) 104 if not result and shortcut: 105 return False /software/lsstsw/stack_20181012/stack/miniconda3-4.5.4-fcd27eb/Linux64/pex_config/16.0-7-g9645df7+1/python/lsst/pex/config/config.py in _compare(self, instance1, instance2, shortcut, rtol, atol, output) 356 """ 357 v1 = getattr(instance1, self.name) --> 358 v2 = getattr(instance2, self.name) 359 name = getComparisonName( 360 _joinNamePath(instance1._name, self.name), AttributeError: 'SuperConfig' object has no attribute 'bar' {code} *Both* of these comparisons are mistakes: the configs aren't equal, so shouldn't return as if they are (in the first case), and the comparison should certainly not raise. |
Reviewers | Kian-Tat Lim [ ktl ] | |
Status | In Progress [ 3 ] | In Review [ 10004 ] |
Status | In Review [ 10004 ] | Reviewed [ 10101 ] |
Resolution | Done [ 10000 ] | |
Status | Reviewed [ 10101 ] | Done [ 10002 ] |
Meredith Rawls, this is causing the confusing error message we discussed last week. As a workaround, you can simply delete /project/mrawls/hits2014/coadds_dcr2/config/deep_makeCoaddTempExp.py (or probably running with --clobber-config will have the same effect).