Easier inheritance of TimeSeries object
See original GitHub issueI was looking to extend TimeSeries
object to make it easier to convert it to other not yet implemented and internal formats. Usually, I’d do something like
from darts import TimeSeries as DartsTimeSeries
class TimeSeries(DartsTimeSeries):
def to_my_custom_format(self):
pass
The problem with this approach is that all factory methods in TimeSeries
are static and are not aware of the underlying class, which means that
from my_module import TimeSeries
TimeSeries.from_dataframe(df, "time", "value") # -> darts.timeseries.TimeSeries
still returns darts.timeseries.TimeSeries
object without to_my_custom_format()
method. Is there a reason why factory methods are implemented as @staticmethod
and not @classmethod
? The latter would be more friendly from inheritance point of view.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Problems with PostgreSQL 10 for time-series data - Timescale
With its shallow inheritance tree, TimescaleDB avoids these issues, processing fewer tables and allowing easy repartitioning regardless of the ...
Read more >Speed up time series data ingestion by partitioning tables on ...
In this post, we focus on data ingestion and why partitioned tables help with data ingestion. PostgreSQL has had the ability to handle...
Read more >TimescaleDB vs. Postgres for time-series: 20x higher inserts ...
It looks like PostgreSQL to the outside world (in fact, it's packaged as an extension), which means it inherits the rock-solid reliability, tooling,...
Read more >PostgreSQL Time-Series Data Case: Automatic Compression ...
In this article, we'll discuss a case of PostgreSQL time-series data by generating year-on-year and period-over-period comparisons.
Read more >When you think `class(.) == *`, think again! - The R Blog
Note that matrix objects are not array s in that (inheritance) sense, ... multivariate time series ( "mts" ) extending (simple) time series...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Good catch. We’ll also address these cases, thanks for reporting.
Yes, this is a good point. There’s no good reason and we’ll make them classmethods.