GeoscienceAustralia / eqrm

Automatically exported from code.google.com/p/eqrm
Other
5 stars 4 forks source link

reducing source tag spelling mistake issues. #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Run a simulation with a spelling mistake in the fault_source_tag when there 
is a zone_source_tag. 

What happens?

The zone sources are generated, the fault sources are not. The user assumes 
both are used.

Currently EQRM makes silent assumptions.

Info from email;

To fix this David B. suggested we change how the source_tag attribute in the 
EQRM control file is used.  If the tag is used that means the user expects the 
file to be there. EQRM will halt if the file is not there. I'm hoping this will 
reduce unexpected behaviour.  It will mean tags will have to be used though.

Original issue reported on code.google.com by duncan.g...@gmail.com on 26 Mar 2012 at 11:56

GoogleCodeExporter commented 9 years ago
Existing behaviour:

Params
fault_source_tag - defaults to None
zone_source_tag - defaults to None

1. Open file defined by fault_source_tag
- filename is
-- <site_tag>_fault_source.xml if fault_source_tag is None, or
-- <site_tag>_fault_source_<fault_source_tag>.xml if fault_source_tag is not 
None
- fid_sourcepolys = open(filename)
- If IOError caught fid_sourcepolys is None
2. Open file defined by zone_source_tag
- filename is
-- <site_tag>_zone_source.xml if zone_source_tag is None, or
-- <site_tag>_zone_source_<zone_source_tag>.xml if zone_source_tag is not None
- fid_event_types= open(filename)
- If IOError caught fid_event_types is None
3. If both fid_event_types and fid_sourcepolys is None exit in error, otherwise 
continue with either fid_sourcepolys or fid_event_types or both.

Original comment by b...@girorosso.com on 27 Mar 2012 at 6:29

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Proposed change to behaviour:

- fault_source_tag
-- If fault_source_tag is not None
--- filename = <site_tag>_fault_source_<fault_source_tag>.xml
--- if filename not exists raise RuntimeError and exit
--- else return open(filename)
-- If fault_source_tag is None
--- return None
-- If IOError caught fid_sourcepolys is None (same as existing behaviour - 
hopefully this will not be applicable any more)
-- Log info message to specify which file is being used, or that the file is 
not specified

- zone_source_tag
-- If zone_source_tag is not None
--- filename = <site_tag>_zone_source_<zone_source_tag>.xml
--- if filename not exists raise RuntimeError and exit
--- else return open(filename)
-- If fault_source_tag is None
--- return None
-- If IOError caught fid_event_types is None (same as existing behaviour - 
hopefully this will not be applicable any more)
-- Log info message to specify which file is being used, or that the file is 
not specified

- If both fid_event_types and fid_sourcepolys is None exit in error, otherwise 
continue with either fid_sourcepolys or fid_event_types or both (same as 
existing behaviour).

Original comment by b...@girorosso.com on 28 Mar 2012 at 2:23

GoogleCodeExporter commented 9 years ago
Revision 1027 implements the above changes. Documentation, scenarios and demos 
updated accordingly.

Original comment by b...@girorosso.com on 29 Mar 2012 at 4:13

GoogleCodeExporter commented 9 years ago

Original comment by b...@girorosso.com on 29 Mar 2012 at 4:13

GoogleCodeExporter commented 9 years ago
Reopening as unit tests need to be updated (they currently fail).

Original comment by b...@girorosso.com on 30 Mar 2012 at 5:17

GoogleCodeExporter commented 9 years ago
Revision 1028 fixes the unit tests.

Original comment by b...@girorosso.com on 30 Mar 2012 at 5:29