Changes between Initial Version and Version 1 of Ticket #341
- Timestamp:
- Sep 16, 2009, 2:14:39 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #341 – Description
initial v1 1 1 We need to think about refactoring the code users change to run ANUGA. This is files like project.py, setup_model.py, etc. 2 2 3 Currently the code to put ASCelevations into ANUGA looks like: 4 convert_dem_from_ascii2netcdf(project.demname, ...) 5 dem2pts(project.demname, ...) 6 domain = create_domain_...(...) 3 Currently the code to put ASCelevations into ANUGA looks like:[[BR]] 4 convert_dem_from_ascii2netcdf(project.demname, ...)[[BR]] 5 dem2pts(project.demname, ...)[[BR]] 6 domain = create_domain_...(...)[[BR]] 7 7 domain.set_quantity('elevation', project.demname+'.pts', ...) 8 8 9 Hidden away under all that is the assumption that the filename passed to dem2pts() is just a root and '.dem' is *assumed* as the extension. This leads to confusion as: 10 1. project.demname is used all over as a root filename, no real names used, 9 Hidden away under all that is the assumption that the filename passed to dem2pts() is just a root and '.dem' is *assumed* as the extension. This leads to confusion as:[[BR]] 10 1. project.demname is used all over as a root filename, no real names used,[[BR]] 11 11 2. sometimes extensions are supplied to a function with the filename, sometimes not. 12 12 … … 15 15 Additionally, it may now be possible to get ANUGA code to *automatically* convert files. If we say that a file is an "input elevation" file, then ANUGA can convert an ASC file to a DEM file just by looking at the extension (not a real good idea, but simple) or by some 'file'-like magic (do 'man file'). 16 16 17 Similarly, a consistent function naming convention would be nice. In runcairns.py we see this to convert an ASC file to a DEM file: 18 convert_dem_from_ascii2netcdf(project.demname, ...) 17 Similarly, a consistent function naming convention would be nice. In runcairns.py we see this to convert an ASC file to a DEM file:[[BR]] 18 convert_dem_from_ascii2netcdf(project.demname, ...)[[BR]] 19 19 dem2pts(project.demname, ...) 20 20 21 This could look like: 22 asc2dem(project.demname, ...) 21 This could look like:[[BR]] 22 asc2dem(project.demname, ...)[[BR]] 23 23 dem2pts(project.demname, ...) 24 24 25 25 or 26 convert_asc_to_dem(project.demname, ...) 26 convert_asc_to_dem(project.demname, ...)[[BR]] 27 27 convert_dem_to_pts(project.demname, ...) 28 28