Skip to content

Big cleanup and todo #4

@emolch

Description

@emolch

Mopad in its present form is not very useful as a Python module and many things could be improved. Here just a few suggestions in random order:

  • the BeachBall methods ploBB(), save_BB(), pa_plot, full_shere_plot() should be renamed into a consistent naming scheme

  • these methods take kwargs not **kwargs, why? This is not very intuitiv to use (and the documentation of the method is even wrong):

     beach.save_BB(dict(plot_outfile='mopad.png', plot_outfile_format='png'))
    
  • the string/value hybrid behaviour of the getter functions in MomentTensor should be avoided

  • exceptions raiseid in the code should contain proper information about what has gone wrong

  • error messages should never be printed to stdout

  • remove print statements in the getter functions of MomentTensor (this should be fixed quickly, because, whoever sees this will never again want to have a single look at mopad).

  • is there any good reason for using realpath() and abspath() when dealing with filenames in this code?

  • many of the excessive if-elif-else-orgies could be replaced with simple dict mappings. This would heavily shorten the code.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions