Skip to content

Make loadData uses factory pattern instead of instantiating data object directly

Kien Le requested to merge refactor-load_data_use_factory_method into master

Implement the factory pattern for data loading.

Currently, loadData instantiates either RT130 or MSeed to create the object that stores loaded data. Because the constructor for these two classes takes only *args and **kwargs as arguments, there is no way to use static analysis on them. As a workaround, we create a factory method that takes explicit arguments to handle the creation of the data object. Seeing as this method has named arguments, we can use type hints to do static analysis on it.

Merge request reports

Loading