• 162 views | 3 messages Discussion: LEAP
    Topic: Automating Yearly Shape Subscribe | Previous | Next
  • Anik Singh 7/3/2024

    Hi,
    I am running some tests using time slice reduction and in order to fully test out the efficiency I need to create 100's of models. To do that I have to manually enter each model file and then import data from excel for 3 different year shapes which is not very time consuming but when you add in the fact I am doing 100's and some of the larger time slices take more time in updating the yearly shape. I have already made use of the LEAP-python integration to automate running and comparing results. I was wondering if there was a simple way to edit the yearly shapes either through code or through a database editor. I noticed most of the time slice data is stored in NX1 files. But I do not fully know sql so I dont know if there is a way using a database editor to quickly change the yearly shape using the excel files I am generating.

    Thanks
  • Taylor Binnington 8/14/2024
      Best Response

    Hi Anik -

    Though it's possible to modify the nx1 files with an appropriate editor, we strongly discourage you from doing so. I see you're already found the LEAP API (https://leap.sei.org/help24/API/Yearly_Shapes_API.htm), as that's where we would have pointed you.

    Otherwise, you could try using the ReadFromExcel() function, instead of YearlyShape(), and point it to a range within an Excel workbook that contains values for each time slice. These values could be manipulated in Excel using whichever tool you want, before re-running LEAP.

    Hope this helps,
    Taylor
  • Anik Singh 8/14/2024
      Best Response

    Hi Taylor,

    Thanks I did not notice the ReadFromExcel() function, I will test with this to see if it works. I ended up manually altering the previous models but getting this working will help me save a tonne of time if I have to recreate any of the sets.

    Thanks,
    Anik Singh