Ticket #10482 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Add a date filter to GeneratePythonScript

Reported by: Dan Nixon Owned by: Dan Nixon
Priority: major Milestone: Release 3.3
Component: Framework Keywords:
Cc: sanghamitra.mukhopadhyay@… Blocked By:
Blocking: #10492 Tester: Harry Jeffery

Description

Add a from and between field that timestamps and will return only algorithms where the start time is between those two timestamps.

This will allow extracting a script to recreate the actions taken in a specific part of a custom interface.

Change History

comment:1 Changed 6 years ago by Dan Nixon

  • Status changed from new to assigned

comment:2 Changed 6 years ago by Dan Nixon

  • Status changed from assigned to inprogress

Added a date filter for HistoryView

and added to unit tests

Refs #10482

Changeset: 13ce0277a661cb75bddf2dfa7bf7d24eb553d740

comment:3 Changed 6 years ago by Dan Nixon

Added filter properties to GeneratePythonScript algorithm

Refs #10482

Changeset: a4af130990ac71484842be0b6729345e1a093f18

comment:4 Changed 6 years ago by Dan Nixon

Made time ranges inclusive.

Refs #10482

Changeset: 1723e5a46c299cbc31b70d4b7a3f83a4e27dd185

comment:5 Changed 6 years ago by Dan Nixon

Added doc tests for GeneratePythonScript

Refs #10482

Changeset: 7af97f83a5397ec42c09b89263d09bd769e5ae95

comment:6 Changed 6 years ago by Dan Nixon

Added more documentation to GeneratePythonScript

Refs #10482

Changeset: 845fd9be5dea6daa4a7c51d7a2260587771ead7d

comment:7 Changed 6 years ago by Dan Nixon

To test:

  • Ensure doc tests and unit tests pass
  • Open a workspace from system tests
  • Run some algorithms on it
  • Open the GeneratePythonScript algorithm
  • Enter yesterdays date for StartTimestamp (see property description for format)
  • Run
  • Note in result script only Load and any algorithms you executed are listed

comment:8 Changed 6 years ago by Dan Nixon

  • Status changed from inprogress to verify
  • Resolution set to fixed

comment:9 Changed 6 years ago by Dan Nixon

  • Blocking 10492 added

comment:10 Changed 6 years ago by Martyn Gigg

  • Status changed from verify to reopened
  • Resolution fixed deleted

It looks like there is a slight bug in HistoryView::filterBetweenExecDate, which the Windows debug build has picked up: http://builds.mantidproject.org/view/Develop%20Builds/job/develop_clean_win7_debug/128/console.

The MSVC debugger says that line 185 is invalid as the iterator is not valid anymore. I think a way to avoid hitting this problem is to slightly change how the iteration is done by doing:

  for (auto it = m_historyItems.begin(); it != m_historyItems.end();)
  {
    Mantid::Kernel::DateAndTime algExecutionDate = it->getAlgorithmHistory()->executionDate();

    // If the algorithm is outside of the time range, remove it and keep iterating
    if(algExecutionDate < start || algExecutionDate > end)
    {
      it = m_historyItems.erase(it);
    }
    else ++it;
  }

so that you only increment the iterator if nothing was erased and use the iterator returned from .erase if something was erased.

comment:11 Changed 6 years ago by Dan Nixon

  • Status changed from reopened to inprogress

Fix Windows debug build

Refs #10482

Changeset: af2488d178a124950edeaa26787c9eb018c23aee

comment:12 Changed 6 years ago by Dan Nixon

  • Status changed from inprogress to verify
  • Resolution set to fixed

comment:13 Changed 6 years ago by Harry Jeffery

  • Status changed from verify to verifying
  • Tester set to Harry Jeffery

comment:14 Changed 6 years ago by Harry Jeffery

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/10482_date_filter_for_GeneratePythonScript'

Full changeset: c008136d546876794e2b398502ec5c84af449ca8

comment:15 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 11324

Note: See TracTickets for help on using tickets.