Jump to content

patjdixon

Super Seeqer
  • Posts

    94
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by patjdixon

  1. Mark, yudaman! Thanks, zip files are attached. Happy 4th! ForMark-PulledWorkbook.zip ForMark-Templates.zip
  2. I think you are right. Everything seems to work. I do want the links in the template, but I need to figure out how to get the instance to have those figures (Trend, XY Plot, Table) configured so I don't have to manually recreate them. I think the Mustache templating system will help. Actually, looking at the "Workbook Templates" help, it looks like Mustache would only allow variables that are text or signals, not worksteps that would open preset Trend, XY Plot, Table, etc. Therefore, I think I just have to live with the error messages; I don't see another way.
  3. I don't understand how the wrong code got uploaded. Here it is again, and it should show the same result as the image. There is no stack trace available. I do have links in the template: WorksheetAppend_testcode-2.ipynb
  4. I have it working, but I am getting an error. It does not prevent execution, but I want to clean it up. The code I have that is working is: This does insert new worksheets, but I have errors that seem to indicate push is trying to push the template workbook, which I do not want to do. I only want to push new worksheets to the existing workbook I have: WorksheetAppend_testcode.ipynb
  5. To be clear, if I run this 5 times with and rename template_worksheet.name each time, I will end up with 1 worksheet that has the name of the last template_worksheet.name. What I want is 5 worksheets with the names I assign for each worksheet.
  6. I found a problem. Append does not append the worksheets in the workbook. The template worksheet ID gets pushed and just replaces the worksheet that is there. When you change the worksheet name, the ID is retained so you do not add another worksheet. It just renames the worksheet already there. I need a way to append a workbook with instances of the template worksheet. Ideas?
  7. On the line: if template_worksheet.name in workbook.worksheets: I get: AttributeError: 'WorkbookList' object has no attribute 'worksheets'
  8. I am trying to push a worksheet, not workbook. I have a workbook 'Pulmac TestInstanceWorkbook' and want to push the template worksheet 'Signal List' into it.
  9. I am trying to follow 'Workbook Templates' example in SPy documentation to push a worksheet template into a workbook. I believe the correct command is: spy.push(workbook={new workbook ID that I am pushing to}, worksheet={template worksheet ID that I want to insert into the new workbook}) I find the push gives me a link to the correct workbook that I want to push to, but no worksheet is inserted. I know that the template worksheet is the correct ID. If I replace the worksheet ID with a string for a worksheet name, it will insert a blank worksheet with that name. See attached files. What am I doing wrong? CreateInstancesFromTemplates.ipynb
  10. If I use spy.search type “Chart’ does that return the trend in the worksheet? Would that be the way I do it?
  11. I would like to have a DataLab script that can take a trend, XY plot, table, or other item in a Workbench worksheet and insert the linked object in an Organizer page. I know how to do this manually, but I do not see a way to do this in DataLab. Ideas?
  12. Thanks Mark, it works. I would still like to know where to look to find the documentation on this.
  13. ChatGPT says look in the spy library for the replacement for the deprecated ".document" function, but I have been looking and don't see anything
  14. I obviously have a syntax issue. Other than ChatGPT, is there somewhere I can go to find examples and documentation on how to do this correctly?
  15. Until R60 I had a script that used ".document" to save images to file. Now I get a warning that this is a deprecated function. It is suggested to replace it with AnalysisWorksheet "journal" or TopicDocument "report". I am looking for some examples of what this should be changed to. Any suggestions?
  16. Here is the fix: ax.plot(xdata, ydata[Lab_Pred_DF_Plot_RampCond["Name"]], color=ydatacolor[YDataRow], linestyle=ydatalinetype[YDataRow])
  17. I have a partial answer: this works ax.plot(xdata, ydata["Lab_Opacity_PRED"]) Is there a better way? I want to take the spy.pull signal and convert it to a list without having to specify the name of the attribute; just remove the timestamps.
  18. I have a DataLab script that has worked until R60. Now I get InvalidIndexError: (slice(None, None, None), None) on the "plot" argument of matplotlib.pyplot. I suspect the issue is that the format of the ydata argument has changed: Lab_Pred_Fig = plt.figure(figsize=[20,10]) ax = Lab_Pred_Fig.add_subplot(1, 1, 1) ax.plot(xdata, ydata) xdata is a simple list, but ydata is obtained from a spy.pull as shown here: How do I fix this in R60?
  19. If you use a formula to create a regression model, such as: $target.regressionModelOLS($training, false, $signal1, $signal2) you cannot access model statistics and coefficients, like these: Therefore, to get this data you need to use the Get() function. However, it does not work on an existing model. It only seems to work if the model is created in the same formula as the Get() function Is there any work around? I was hoping DataLab might help, but if I search the prediction tag for all properties I get 23 columns, none of which are coefficients.
  20. Hurrah, done! Mark, thanks for hanging in there. I know I was slow on the uptick, but when I finally figured out the dictionary list thing it worked. The problem I had is that I did not know what format Formula Parameters was. The fixed code is attached. My next issue is going to be getting model coefficients. When you create a regression model with a formula instead of using the WorkBench 'Model & Predict' interface, you cannot see the statistics and model coefficients. The Get() formula does not seem to work unless you re-specify the model formula. I am going to create a separate topic on that. PM_SIM_SetModels_230416.ipynb
  21. Mark, I will try your way and ensure the search returns IDs
  22. I am getting closer. The first attachment shows the format of Formula Parameters in the metadata The next attachment shows that the only difference is double quotes instead of single quotes How would I fix this?
  23. The issue is that a variable used for Formula Parameters requires some unknown format or syntax, or can't be done at all. In the first attachment, I use a hard coded Formula Parameters argument, and it works as expected In the next attachment, I use the variable FormulaList with the ID appended and I get a syntax error In the last attachment, I format FormulaList as a string and the push fails Has anyone ever done this successfully?
×
×
  • Create New...