You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are a developer, or prospective developer, of a seismology package which uses ObsPy we highly recommend you adhere to the following guidelines. Doing so will help ensure your project is maintainable, attractive to potential contributors, and interoperable with other ObsPy-based codes. We also offer some suggestions that you may find useful.
Write your code in a way that is readable and understandable by others. Adhere to pep8 and the ObsPy coding style guide, deviating only slightly when there is good reason to do so. Using an automated linter/formatter like black or flake8 makes this easy.
Use classes and functions from ObsPy wherever appropriate. For example, the obspy Stream, Catalog, and Inventory objects should always be valid inputs for functions that require waveform, event, or station data, respectively. This does not mean that other data formats cannot also be supported, but supporting ObsPy data structures is essential for achieving interoperability between seismology packages.
Create documentation that adequately explains the purpose of your package and how to use it. Effective documentation will give the reader a brief explanation of what the software does and demonstrates some simple examples very early on. Additionally, user-facing classes and functions should all have docstrings.
Include an automated test suite that covers your code’s intended functionality as well as possible. Use an existing python testing frameworks like pytest or unittest.
Be open to contributions from others. Put your code on a hosted collaborative development service like GitHub and apply a standard open-source license to your project.
Make an effort to connect with the ObsPy developer community. We are a friendly fun-loving group (especially Tobias) and happy to help if you need advice or someone to bounce ideas off. The best place to find us is on gitter.
Write out a “quickstart” section of your documentation before writing any code, and revisit it often. This will help you keep a user-friendly interface a primary goal during the development cycle.
Follow a Test Driven Development (TDD) paradigm which will help you design modular, testable code. However, try to write tests that will not make it difficult to refactor your code later on. Understand that software testing is an art and it will take some time to master.