Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC]: Time Series Generation Module #2092

Open
3 tasks done
AhmedKhaled590 opened this issue Mar 30, 2024 · 2 comments
Open
3 tasks done

[RFC]: Time Series Generation Module #2092

AhmedKhaled590 opened this issue Mar 30, 2024 · 2 comments
Labels
difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. Feature Issue or pull request for adding a new feature. JavaScript Issue involves or relates to JavaScript. Needs Discussion Needs further discussion. RFC Request for comments. Feature requests and proposed changes. Utilities Issue or pull request concerning general utilities.

Comments

@AhmedKhaled590
Copy link
Contributor

Description

This RFC proposes the addition of a Time Series Generation module to @stdlib/time module. This module will facilitate the creation of sequences of dates or timestamps based on various patterns or intervals, catering to the needs of applications requiring regularly spaced time data.

The Time Series Generation module will offer flexibility in defining intervals, allowing users to specify common patterns such as daily, weekly, monthly, quarterly, or yearly intervals. Additionally, users will have the option to define custom intervals with arbitrary durations to suit specific requirements.

Key features of the Time Series Generation module include support for specifying start and end dates for the time series, handling of leap years.

This module aims to provide a convenient and efficient solution for generating time series data, enabling users to perform tasks such as financial analysis, data visualization, and scheduling with ease and accuracy.

Example for how this function can be called

const { generateTimeSeries } = require('@stdlib/time');

const startDate = new Date('2024-01-01');
const endDate = new Date('2024-12-31');

const customSeries = generateTimeSeries({
    interval: {
        unit: 'month',
        value: 3 // every 3 months
    },
    start: startDate,
    end: endDate,
format: 'YYYY-MM-DD'
});

console.log(customSeries);
/*
[
    '2024-01-01',
    '2024-04-01',
    '2024-07-01',
    '2024-10-01'
]
*/

If this feature request gets the green light, I'd be happy trying implementing it.

Related Issues

N/A

Questions

No.

Other

No.

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.
@stdlib-bot
Copy link
Contributor

👋 Hi there! 👋

And thank you for opening your first issue! We will get back to you shortly. 🏃 💨

@kgryte
Copy link
Member

kgryte commented Apr 4, 2024

For reference, while this RFC proposes a more configurable API, I'll note that we already have @stdlib/array/datespace.

I don't think the format option is particularly desirable. However, the ability to specify an increment is desirable. In which case, personally, I can possibly see an argument to add @stdlib/array/incrdatespace (similar to @stdlib/array/incrspace). However, one could also use incrspace already for this purpose; it just wouldn't be as convenient as returning Date objects directly.

@kgryte kgryte added RFC Request for comments. Feature requests and proposed changes. Feature Issue or pull request for adding a new feature. Needs Discussion Needs further discussion. Utilities Issue or pull request concerning general utilities. JavaScript Issue involves or relates to JavaScript. difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. labels Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: 2 May require some initial design or R&D, but should be straightforward to resolve and/or implement. Feature Issue or pull request for adding a new feature. JavaScript Issue involves or relates to JavaScript. Needs Discussion Needs further discussion. RFC Request for comments. Feature requests and proposed changes. Utilities Issue or pull request concerning general utilities.
Projects
None yet
Development

No branches or pull requests

3 participants