Run - Extends SMath Studio with the ability to run other worksheets in background - Сообщения

#1 Опубликовано: 12.04.2016 14:46:51
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: Moderator

SMath Studio compatibility SMath Viewer compatibility mono compatibility

extension page Sources MIT license


  • installation: SMath Studio: Tools > Plugins... > Online Gallery (be sure to have the "Exclude beta-versions" unchecked);
  • documentation: (beta) Run Example.7z (4 КиБ) скачан 215 раз(а)..


>>> PLEASE REPORT IN THIS TOPIC ANY ISSUE, MORE DETAILED AS POSSIBLE <<<
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
5 пользователям понравился этот пост
sergio 12.04.2016 15:41:00, ElSid 12.04.2016 16:35:00, frapuano 12.04.2016 16:49:00, Вячеслав Мезенцев 13.04.2016 01:14:00, Kemili 13.04.2016 13:38:00
#2 Опубликовано: 12.04.2016 16:09:25
Ruben Sidranski

Ruben Sidranski

17 сообщений из 463 понравились пользователям.

Группа: User

Will this allow us to transfer data? SWEET!
Only thing better would be not needing to use data propagation between the worksheets (e.g. using rfile,
wfile, importData, exportData, ...).
#3 Опубликовано: 13.04.2016 14:21:48
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: Moderator

Wrote

Will this allow us to transfer data? SWEET!


Is more targeted to process data "remotely"; data transfer is driven by existing functions (also include());

Wrote

Only thing better would be not needing to use data propagation between the worksheets (e.g. using rfile, wfile, importData, exportData, ...).


I think the only other way, in the scenario drawn in the example of the first post, would be to transfer data via functions, that is not a feasible way as for now.

Also, I have to improve the log system to better recognize if there are errors in the target worksheets.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#4 Опубликовано: 15.04.2016 17:12:30
Ruben Sidranski

Ruben Sidranski

17 сообщений из 463 понравились пользователям.

Группа: User

How is this different than "Include" plug in by Uni?

#5 Опубликовано: 16.04.2016 12:39:42
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: Moderator

Wrote

How is this different than "Include" plug in by Uni?



Mainly:

include() loads the SMath variables/functions from the target worksheet into the one in use, while in Run() each worksheet is indipendent;
include() can't run non-math regions (ComboBoxList, etc...) while Run() execute everything;
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#6 Опубликовано: 27.08.2016 02:28:06
NDTM Amarasekera

NDTM Amarasekera

130 сообщений из 352 понравились пользователям.

Группа: User

Wrote

  • requirements: SMath Studio 0.98.5935 or later;
  • installation: SMath Studio: Tools



  • Problem in 98.6081?

    Run error.png
    Look within!... The secret is inside you. Best Regards Eng. NDTM Amarasekera - Sri Lanka
    #7 Опубликовано: 27.08.2016 08:48:06
    Jean Giraud

    Jean Giraud

    983 сообщений из 6866 понравились пользователям.

    Группа: User

    Hello collab ndtma,

    Don't take my comment bad. Your snippets are always blurry [not comfortable].
    You can "PrintScreen" paste in Paint to select the portion. That results in
    huge BMP... then reduce to 256 via IrfanView: superfreeware of multiuse ...
    mostly: sharpen image, superbe Lanczos zoon [square/rectangular] gray/color
    images ++++ .
    I use this technique as well as capture a selected region from WinGrab
    [freeware]. Wingrag has more options to reduce 256 colors, in many difficult
    cases of better quality than IrfanView, though is does not apply to Smath snippets.

    Cheers, Jean
    #8 Опубликовано: 27.08.2016 10:10:59
    NDTM Amarasekera

    NDTM Amarasekera

    130 сообщений из 352 понравились пользователям.

    Группа: User

    Hello Jean,

    Thanks for your valuable suggestions.
    Look within!... The secret is inside you. Best Regards Eng. NDTM Amarasekera - Sri Lanka
    #9 Опубликовано: 27.08.2016 10:29:53
    Davide Carpi

    Davide Carpi

    1415 сообщений из 2872 понравились пользователям.

    Группа: Moderator

    Wrote

    Problem in 98.6081?



    Hello ndtma,

    yes, seems there are isSies with the process handle. I'm looking to find the cause and if I can solve it
    If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
    #10 Опубликовано: 29.08.2016 13:05:21
    Davide Carpi

    Davide Carpi

    1415 сообщений из 2872 понравились пользователям.

    Группа: Moderator

    Issue found.


    edit: fixed in SS 0.98.6179
    If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
    #11 Опубликовано: 01.11.2018 15:30:04
    Kyle Sullivan

    Kyle Sullivan

    0 сообщений из 7 понравились пользователям.

    Группа: User

    Hi Davide, I created my own example with a 3x3 excel table and it takes about 6 seconds for the "Run" function to execute each row of test data during the for loop. The smath sheet it's running contains 2 variables multiplied together and output as a variable 'd'. Your entire example runs in 22 seconds, with definitely a bit more complexity, but not much. Any ideas here? I'd like to run 400 rows of data (load cases for different members) through a calc sheet and collect the results, just like you've done (except only one calc sheet, not 3 like you've done).

    thx!

    20181101-001874 screenshot.png
    #12 Опубликовано: 02.11.2018 07:24:46
    Davide Carpi

    Davide Carpi

    1415 сообщений из 2872 понравились пользователям.

    Группа: Moderator

    Currently each Run function triggers a new instance of SMath Studio; this means that all the initialization process must be done every time, rising the execution time. What you can try is to change the logic to start a single run with multiple worksheets, and init/finalize each loop step in a dedicated file.

    new loopSheet.sm
    2018-11-02 12_24_53-Window.png

    initCalc.sm
    2018-11-02 11_23_04-Window.png

    handleCalcResults.sm
    2018-11-02 11_23_10-Window.png
    If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
    1 пользователям понравился этот пост
    Kyle Sullivan 02.11.2018 13:55:00
    #13 Опубликовано: 02.11.2018 14:32:57
    Kyle Sullivan

    Kyle Sullivan

    0 сообщений из 7 понравились пользователям.

    Группа: User

    Thanks for the response Davide.

    So I went ahead and tried out your idea, it does solve the only 'running' once issue and finishes the script in 6 seconds no matter what.

    But now I have the issue where the Run(exec) command does not seem to be running all the scripts in the exec matrix, or somehow it's only saving the first 'calcResults' in 'allResults'. That said, I was successful in manually looping the 3 sheets, so I thin something is going on incorrectly in the run(exec) line.

    You can see what I did in the gifs below if you open them full size in a new tab..

    Thoughts?

    Calc completed successfully by manually looping the 3 sheets:

    Manual loop method works

    Calc running with loop sheet, only records first row result:

    Calc running with loop sheet
    #14 Опубликовано: 02.11.2018 15:52:52
    Jean Giraud

    Jean Giraud

    983 сообщений из 6866 понравились пользователям.

    Группа: User

    Wrote

    so I think something is going on incorrectly in the run(exec) line.


    That I don't understand the idea/purpose of run does not indicate it is useless.
    Do you mean run would calculate in a cash of some sort a selection of work sheets
    and then would show all calculated by clicking "Open file" ?

    #15 Опубликовано: 02.11.2018 18:21:03
    Alvaro Diaz Falconi

    Alvaro Diaz Falconi

    992 сообщений из 1674 понравились пользователям.

    Группа: User

    Wrote

    Thanks for the response Davide.
    ...
    You can see what I did in the gifs below if you open them full size in a new tab..

    Thoughts?
    ...



    Hi K. Gif shows that you modify iniCalc.sm (disabling some calcs) but don't save it, so others SMath files read the original iniCalc.sm, not the modified. Is this the issue or I'm are not understanding something else?

    Best regards.
    Alvaro.
    #16 Опубликовано: 03.11.2018 00:05:52
    Kyle Sullivan

    Kyle Sullivan

    0 сообщений из 7 понравились пользователям.

    Группа: User

    I reran it after saving everything and the same thing happened..here's a non-gif image and the files. I guess Davide's example ran fine so I should be able to figure this out haha. I'm currently troubleshooting so stay posted

    testCalc.sm (3 КиБ) скачан 58 раз(а).
    handleCalcResults.sm (5 КиБ) скачан 48 раз(а).
    initCalc.sm (9 КиБ) скачан 55 раз(а).
    input.xlsx (8 КиБ) скачан 47 раз(а).
    loopSheet.sm (10 КиБ) скачан 51 раз(а).

    20181102-001882 screenshot.png


    This gave me what I want..
    Run(exec)
    Run(exec)
    Run(exec)
    20181102-001887 screenshot.png

    I quit, there's something with run() only running files if they have a different name, or the Run(exec) is called again (like above). I created a new, simpler example.. Below shows that if exec is defined with 3 separate but identical calc.sm files (calc1.sm, calc2.sm, etc) then run(exec) will run all 3 files and the allResults var is fully populated. If I define exec as a vector with all the same calc.sm files then it won't work and allResults will just end up with the first result.

    20181102-001888 screenshot.png

    calcSheet.sm (5 КиБ) скачан 48 раз(а).
    loopSheet.sm (5 КиБ) скачан 46 раз(а).
    #17 Опубликовано: 03.11.2018 15:46:07
    Davide Carpi

    Davide Carpi

    1415 сообщений из 2872 понравились пользователям.

    Группа: Moderator

    You are right, I have to investigate it.
    If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
    #18 Опубликовано: 03.11.2018 20:54:20
    Jean Giraud

    Jean Giraud

    983 сообщений из 6866 понравились пользователям.

    Группа: User

    Wrote

    I reran it after saving everything and the same thing happened



    Document calcSheet calculates nothing [no maths/formula(s)/result(s)]
    Certainly no gadget will retrieve something from nothing, is it ?

    If calcSheet calculates something, save to file and retrieve from
    any other Smath work sheet. On the other hand, you may save formula(s)
    in calcsheet and retrieve from any other Smath work sheet then modify
    the formula(s) in the working document ... per say change parameters.

    You say nothing about what you have in mind.
    #19 Опубликовано: 03.11.2018 22:54:49
    Kyle Sullivan

    Kyle Sullivan

    0 сообщений из 7 понравились пользователям.

    Группа: User

    Wrote

    Document calcSheet calculates nothing [no maths/formula(s)/result(s)]



    I know in this case calcSheet.sm is not "calculating" anything. The whole problem we're trying to solve is looping a large data set through the calcSheet, row by row, which processes the data with whatever formulas we want, in this case it's 1*data my previous example actually took one of the values in the 'current row' and multiplied it by 3. I just wanted to make the example here as simple as possible so we could hone in on the problem.
    #20 Опубликовано: 04.11.2018 12:38:23
    Jean Giraud

    Jean Giraud

    983 сообщений из 6866 понравились пользователям.

    Группа: User

    Wrote

    I know in this case calcSheet.sm is not "calculating" anything. The whole problem we're trying to solve is looping a large data set through the calcSheet, row by row, which processes the data with whatever formulas we want, in this case it's 1*data my previous example actually took one of the values in the 'current row' and multiplied it by 3.I just wanted to make the example here as simple as possible so we could hone in on the problem.


    Simply attach the basic project and describe the next part of the project.
    As you explain, it looks weird from maybe baby simple.

    MatrixStuff.PNG

    • Новые сообщения Новые сообщения
    • Нет новых сообщений Нет новых сообщений