Skip to content

Create generate Rrule Function#1565

Open
davanmur wants to merge 199 commits into
OpenEnergyDashboard:timeVaryfrom
davanmur:generateRrule_from1516
Open

Create generate Rrule Function#1565
davanmur wants to merge 199 commits into
OpenEnergyDashboard:timeVaryfrom
davanmur:generateRrule_from1516

Conversation

@davanmur

@davanmur davanmur commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

Description

Created a backend function that could take in information from the weekly and daily conversion patterns, and created an rrule (recurrence rule) so that conversions patterns could easily and efficiently be applied over a length of time. Integrated that function in timeVaryingPathConversion.js.

Partly Addresses #896

Type of change

  • Note merging this changes the database configuration.
  • This change requires a documentation update

Checklist

  • I have followed the OED pull request ideas
  • I have removed text in ( ) from the issue request
  • You acknowledge that every person contributing to this work has signed the OED Contributing License Agreement and each author is listed in the Description section.

Limitations

  • Based on my manual testing generateRrule.js works and segments are correctly added to edgeSegments timeVaryingPathConversion.js
  • The is an issue with memory that seems to be related to a potentially infinite while in timeVaryingPathConversion.js

minhtriet359 and others added 30 commits June 29, 2025 18:28
Currently read-only. Uses fake data, as the Weeks API is not yet implemented.
Signed-off-by: PRINCESANCHEZ <princesanchez72@gmail.com>
* CRUD operations working with back-end
* client-side validation
* delete confirmation
* Spanish and French translations
Omit `id` from the default week values model
docker-compose should not be ignored and should not have to be altered for our time-varying conversion work
…on conflict

Signed-off-by: PRINCESANCHEZ <princesanchez72@gmail.com>
PRINCESANCHEZ and others added 29 commits September 12, 2025 12:55
Signed-off-by: PRINCESANCHEZ <princesanchez72@gmail.com>
This appears to be a basic working version for both
slope/intercept and patterns. I wanted to save the
work to be safe. Here is what was done:

- Fixed addition of segments to match pre-pattern
method and get code to work properly.
- Changed how -infinity & infinity are dealt with. They are
converted to fixed dates so the code works.
This isn't the ideal/final solution but works for now.
- Fixed the exact dates included in a pattern.
- Move conn to last argument since most functions do that.
- Clarified some commenting.
- Minor formatting.
- There are a lot of debug console statements due to
the need to test more. They will be removed.
Mostly to protect against a mistake.
This version is not yet working in all cases but
committing at this point.

- The earlier fix to shift by 1 day caused it to make mistake.
This changes it to shift by 1 minute that seems to work.
- Unwinding the RRule set the end time with the
duration rather than adding the duration to the start time.
- Misc. commenting & debug console (to be removed)
- The edgeSegments were not yet sorted per a comment
so that was added.
- Added comments to timeVaryingPathConversion.
This version was moderately tested and seem to
work reasonably. The debug statements are removed
along with old code that had issues. There are still
some items to do including getting cik done with cik_vary
and testing/working on suffix units.
- The new code treated the result of invertConversion
as an object but it was an array. Decided to convert
to object and fix other call to work.
- Fix invertConversion so works if slope or conversion
are zero.
- Misc minor fixes.
- Suffix units do not work yet and have NaN for slope/intercept.
This is a version that has been moderately tested.
For the first time the test data for developers now works.
It has some TODO item including that it cannot deal
with time-varying conversions with suffix units and
not updating if suffix conversion changes.

- Updated how path was updated to deal with time
varying conversions.
- Changed so cik updated based on cik_vary. This
fixed issues with the old version that had issues
and makes sure they are consistent.
- Remove createCikArray since no longer done.
- Minor comment.
@huss

huss commented Jul 10, 2026

Copy link
Copy Markdown
Member

I have made a sequence of commits lately. At this point the status is:

  • The code works to generate the rule, apply to conversions & put into the DB (cik, cik_vary). This includes general patterns, suffix units, etc.
  • The code passes all tests.
  • The code works for the standard developer test data (not really time-varying).
  • I have read the code carefully to make changes but need to do a final pass that it is ok.
  • More test cases are needed but it does seem to run fine.
  • There are a few open TODO items that can be addressed either before or after this is merged.
  • An open question is when this will merge. There is ongoing work on adding holidays and getting close to a final DB implementation for time-varying. This work includes the unmerged time-varying front-end (still has issues) so that really should be merged first. The other work on DB may get merged first and become the point for moving forward so this would merge on top of that too. It is a version that allows for graphing of data so certain manual tests are much easier. The bottom line is I am okay with it merging when the time is right (after resolving merge conflicts and retesting) as long as it will undergo more testing in the future as will have to be done with the entire time-vary system.

Thanks to @davanmur for this contribution. I look forward to its formal inclusion in OED.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants