Jeremy
Chris
try:
import numpy
read_data = numpy_read_data
...
except ImportError:
try:
import Numeric
read_data = numeric_read_data
...
except ImportError:
raise ImportError("no module named 'numpy' or 'Numeric'")
where numpy_read_data and numeric_read_data have the same signature
and do the same thing (read data from disk), but they do it however is
best for each module. Additional functions like this would be needed,
but if we specified all of them users could use either numpy or
Numeric transparently.
Jeremy
Just something to think about. It may not be necessary to support
both Numeric and numpy and complicate you code in this way. Your
target audience probably already has numpy installed. Both the Gemini
Observatories and the Hubble Space Telescope people now require numpy
to be installed to use their software. Also, SciSoft now comes with
with numpy in its distribution for Mac OSX.
Just let me know.
Cheers,
Chris