Skip to content

Invalid schedules/configs create checkpoints #281

@VeckoTheGecko

Description

@VeckoTheGecko

Describe the bug
The checkpoint mechanism isn't really clear to me - currently running with an invalid schedule creates the checkpoint YAML

To Reproduce
Steps to reproduce the behavior:

  • virtualship init test
  • cd test
  • virtualship run .
❯ virtualship run .     
[TIMER] Expedition started...

╔═════════════════════════════════════════════════╗
║          VIRTUALSHIP EXPEDITION STATUS          ║
╚═════════════════════════════════════════════════╝

---- WAYPOINT VERIFICATION ----

Verifying route... 
... All good to go!

Waypoint 5 could not be reached in time. Current time: 1998-01-01 03:00:14.987829. Waypoint time: 1998-01-01 03:00:00.

Have you ensured that your schedule includes sufficient time for taking measurements, e.g. CTD casts (in addition to the time it takes to sail between waypoints)?

Hint: previous schedule verification checks (e.g. in the `virtualship plan` tool or after dealing with unexpected problems during the expedition) will not account for measurement times, only the time it takes to sail between waypoints.

Please update your schedule (`virtualship plan` or directly in expedition.yaml) and continue the expedition by executing the `virtualship run` command again.
Checkpoint has been saved to checkpoint.yaml.
  • Update the schedule.yaml updating the timing so there's 1D between each
  • virtualship run .
(VirtualShip) (base) 🦎ship/test   problems-nick[$?] ❯ virtualship run .
[TIMER] Expedition started...

╔═════════════════════════════════════════════════╗
║          VIRTUALSHIP EXPEDITION STATUS          ║
╚═════════════════════════════════════════════════╝
Traceback (most recent call last):
  File "/Users/Hodgs004/coding/repos/ship/.pixi/envs/default/bin/virtualship", line 10, in <module>
    sys.exit(cli())
             ^^^^^
  File "/Users/Hodgs004/coding/repos/ship/.pixi/envs/default/lib/python3.12/site-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Hodgs004/coding/repos/ship/.pixi/envs/default/lib/python3.12/site-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/Hodgs004/coding/repos/ship/.pixi/envs/default/lib/python3.12/site-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Hodgs004/coding/repos/ship/.pixi/envs/default/lib/python3.12/site-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Hodgs004/coding/repos/ship/.pixi/envs/default/lib/python3.12/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Hodgs004/coding/repos/ship/src/virtualship/cli/commands.py", line 108, in run
    _run(Path(path), prob_level, from_data)
  File "/Users/Hodgs004/coding/repos/ship/src/virtualship/cli/_run.py", line 95, in _run
    checkpoint.verify(expedition, problems_dir.joinpath(LOG_DIR))
  File "/Users/Hodgs004/coding/repos/ship/src/virtualship/models/checkpoint.py", line 78, in verify
    raise CheckpointError(
virtualship.errors.CheckpointError: Past waypoints in schedule have been changed! Restore past schedule and only change future waypoints (waypoint 5 onwards).

Expected behavior
I expected no checkpoint file to be created on an invalid schedule

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions