-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make --stopcp=reload
use [scheduling]stop after cycle point
instead of the final cycle point
#4543
Conversation
It now takes value from `[scheduling]stop after cycle point` instead of the final cycle point
@@ -53,35 +51,3 @@ for SCP in 1 2 3; do | |||
done | |||
|
|||
purge | |||
|
|||
# Gregorian Cycling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to check this for different cycling types; it should be the responsibility of the tests/unit/cycling
and tests/functional/cyclers
tests to ensure cycle point comparison works
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
#------------------------------------------------------------------------------- | ||
# Test restart with stop point |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This covered the same stuff as tests/functional/restart/08-stop-after-cycle-point.t
if self.config.start_point is None: | ||
# No start cycle point at which to load cycling tasks. | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure this condition is no longer possible. And L691 showing as never hit in code coverage: https://app.codecov.io/gh/cylc/cylc-flow/blob/master/cylc/flow/scheduler.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked in practice. Confirmed I can't get it to be true.
if self.options.startcp: | ||
self.config.start_point = TaskID.get_standardised_point( | ||
self.options.startcp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be unnecessary as duplication of
Lines 669 to 687 in b366e13
def process_start_cycle_point(self) -> None: | |
"""Set the start cycle point from options. | |
Sets: | |
self.options.startcp | |
self.start_point | |
""" | |
startcp = getattr(self.options, 'startcp', None) | |
starttask = getattr(self.options, 'starttask', None) | |
if startcp is not None and starttask is not None: | |
raise UserInputError( | |
"--start-cycle-point and --start-task are mutually exclusive" | |
) | |
if startcp: | |
# Start from a point later than initial point. | |
if self.options.startcp == 'now': | |
self.options.startcp = get_current_time_string() | |
self.start_point = get_point(self.options.startcp).standardise() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirm looks reasonable.
if not self.config.initial_point and not self.is_restart: | ||
LOG.warning('No initial cycle point provided - no cycling tasks ' | ||
'will be loaded.') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again pretty sure this condition is no longer possible (config.initial_point
should be set by this point)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Legit.
if self.is_restart and self.options.icp == 'reload': | ||
LOG.debug(f"- initial point = {value} (ignored)") | ||
elif self.options.icp is None: | ||
self.options.icp = value | ||
LOG.info(f"+ initial point = {value}") | ||
self.options.icp = value | ||
LOG.info(f"+ initial point = {value}") | ||
elif key in self.workflow_db_mgr.KEY_START_CYCLE_POINT_COMPATS: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since #4313, initial and start cycle points cannot change on restart. But still need to set self.options.icp
/startcp
from DB as they are used later to set self.config.initial_point
/start_point
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Read, looks reasonable.
- Checked to see if I can trigger conditions removed as surplus to reqs.
Co-authored-by: Tim Pillinger <26465611+wxtim@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @MetRonnie - good to have this confusing mess cleared up!
These changes partially address #4062
cylc play --stopcp=reload
now does what it says - reload the value from[scheduling]stop after cycle point
. (Previously it would use the value of the final cycle point)Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
andconda-environment.yml
.