[BioRuby] BioRuby standards
Naohisa GOTO
ngoto at gen-info.osaka-u.ac.jp
Tue Sep 2 08:47:11 UTC 2008
Hi,
On Tue, 2 Sep 2008 08:50:56 +0200
pjotr2008 at thebird.nl (Pjotr Prins) wrote:
> Hi everyone,
>
> I have been doing some work on microarray support for BioRuby, see
>
> http://github.com/pjotrp/bioruby/tree/bioruby-testing-pjotr
>
> There are two questions I want to raise about standards, as I see
> different solutions in the current tree. First is about error
> handling. Second about caching.
>
> 1) Error handling ought to print to stderr, and we need a consistent
> way of handling them, as well as a more fine grained approach towards
> warnings, info, debug etc. messages. Can we come up with a standard
> where a user can set these from outside Bioruby, e.g. through an
> environment setting. And what classes can we use for consistent
> messaging. Obviously a standard way for exceptions is part of that.
As you said, no standards, but, empirically in BioRuby,
* Small errors are simply ignored and the program continues.
* When normal (but not severe) errors, prints warning messages
to $stdout, and continues to process.
* When severe error, raises error.
>
> 2) Web based tools often like to cache things on the local file
> system. I suggest using BIORUBY_CACHE as a standard environment
> variable. And, perhaps, BIORUBY_CACHE_SIZE, though that would require
> a module to monitor that.
Because BioRuby is a library (except for BioRuby Shell),
it is generally not so good to depend on environment variables.
Instead, to prepare APIs to set cache positions and sizes
is better.
Note that some classes use Tempfile class, a standard bundled
class with Ruby by default, and the Tempfile class depends
on enviroment variables (TMPDIR, TMP, etc.).
I think cache isn't suitable for standard, because its purpose
may differ from program (or class, module, etc.) to program.
For example, if I want to put class A's cache on a fast hard disk
with very large size, and program B's cache on a slower hard disk
with small size, what should I do?
> For (1) David Powers came up with a nice approach for the Cfruby
> project - where modules can override behaviour of the error handling
> (I wanted that for the Cfenjin application). See
>
> http://rubyforge.org/projects/cfruby/
>
> and the source code at:
>
> http://cfruby.rubyforge.org/svn/lib/libcfruby/flowmonitor.rb
>
> with my usage:
>
> http://cfruby.rubyforge.org/svn/lib/libcfenjin/cfp_logger.rb
> http://cfruby.rubyforge.org/svn/lib/libcfenjin/cfp_flowmonitor.rb
>
> In my case I wanted to override the standard single switch for WARN,
> INFO, DEBUG etc., with a second switch for TRACING, VERBOSITY levels
> and TESTING. For BioRuby it is simpler, as we have (perhaps) have no
> such requirement at the library level.
I've not seen this yet, but is it different from the Logger class,
a standard bundled class with Ruby?
http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc/classes/Logger.html
Thanks,
--
Naohisa Goto
ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org
More information about the BioRuby
mailing list