Skip to content

Commit

Permalink
tests ++
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinepouille committed Oct 17, 2024
1 parent b36367d commit 13c4913
Show file tree
Hide file tree
Showing 8 changed files with 323 additions and 101 deletions.
13 changes: 9 additions & 4 deletions dev/publish-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ Create a new release draft

- Title:
```
Kappa Software Suite version 4.1.3
Kappa Software Suite version v4.1.3
```

- Text:
```
v4.1.3
Kappa Software Suite version 4.1.3
Kappa Software Suite version v4.1.3
```

Set last release as previous tag, then click _Generate release notes_ and edit results to keep what's relevant
Expand All @@ -74,12 +74,17 @@ Add files for:
Kappapp_for_linux.tar.gz
Kappapp_for_mac_os_10.15.zip
Kappapp_for_windows.zip
```
taken from nightly builds: https://tools.kappalanguage.org/nightly-builds/

Source code from release tag https://github.com/Kappa-Dev/KappaTools/releases/tag/v4.1.3 should appear automatically

```
Source code (zip)
Source code (tar.gz)
```

electron are from nightly builds: https://tools.kappalanguage.org/nightly-builds/
Source code from release tag https://github.com/Kappa-Dev/KappaTools/releases/tag/v4.1.3


### Pip

Expand Down
8 changes: 6 additions & 2 deletions gui/state/runtime_web_workers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ class runtime_kasim_as_web_worker () : Api.concrete_manager =
without_kasim#terminate;
kasim_worker##terminate

method is_computing = without_kasim#is_computing || self#sim_is_computing
method is_computing =
without_kasim#is_computing || self#sim_is_computing
|| self#story_is_computing

method project_parse ~patternSharing overwrites =
let simulation_load (patternSharing : Pattern.sharing_level)
Expand All @@ -236,6 +238,7 @@ class runtime_kasim_as_web_worker () : Api.concrete_manager =
overwrites
end

(* TODO: deprecate this? *)
class runtime_kasim_embedded_in_main_thread () : Api.concrete_manager =
let system_process : Kappa_facade.system_process =
object
Expand All @@ -262,7 +265,8 @@ class runtime_kasim_embedded_in_main_thread () : Api.concrete_manager =
without_kasim#terminate;
() (*TODO*)

method is_computing = true (*TODO*)
method is_computing =
without_kasim#is_computing || self#is_computing || self#story_is_computing

method project_parse ~patternSharing overwrites =
let simulation_load patternSharing parsing_compil overwrites =
Expand Down
19 changes: 10 additions & 9 deletions gui/state/state_project.ml
Original file line number Diff line number Diff line change
Expand Up @@ -210,22 +210,23 @@ let set_show_non_weakly_reversible_transitions
update_parameters (fun param ->
{ param with show_non_weakly_reversible_transitions })

let update_state me project_catalog default_parameters project_parameters =
me.project_manager#project_parse ~patternSharing:Pattern.Compatible_patterns
[]
let update_state project project_catalog default_parameters project_parameters =
project.project_manager#project_parse
~patternSharing:Pattern.Compatible_patterns []
>>= fun (out : unit Api.result) ->
set_state
{
project_current = Some me;
project_current = Some project;
project_catalog;
default_parameters;
project_parameters;
project_version = 1;
};
Lwt.return out

let computing_watcher manager setter =
let computing_watcher (manager : Api.concrete_manager) (setter : bool -> unit) =
let delay = 1. in
(* Note: cancel logic seems not to be implemented? *)
let cancelled = ref false in
let rec loop () =
setter manager#is_computing;
Expand Down Expand Up @@ -254,7 +255,7 @@ let add_project is_new project_id : unit Api.lwt_result =
let project_watcher_cancel =
computing_watcher project_manager (set_computes ?step:None)
in
let me =
let project : a_project =
{
project_id;
project_manager;
Expand All @@ -267,9 +268,9 @@ let add_project is_new project_id : unit Api.lwt_result =
Mods.StringMap.add project_id default_parameters
state_va.project_parameters
in
Lwt.return (Result_util.ok (me, me :: catalog, params))))
>>= Api_common.result_bind_with_lwt ~ok:(fun (me, catalog, params) ->
update_state me catalog state_va.default_parameters params)
Lwt.return (Result_util.ok (project, project :: catalog, params))))
>>= Api_common.result_bind_with_lwt ~ok:(fun (project, catalog, params) ->
update_state project catalog state_va.default_parameters params)

let create_project project_id = add_project true project_id
let set_project project_id = add_project false project_id
Expand Down
10 changes: 7 additions & 3 deletions gui/ui/panel_preferences.ml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ module InputPlotPeriod : Ui_common.Div = struct
end

module DivErrorMessage : Ui_common.Div = struct
let id = "configuration_error_div"
let id_error = "configuration_error_div"
let id_alert = "configuration_alert_div"
let id = id_error
(* TODO: clean this id matter *)

let message_nav_inc_id = "panel_preferences_message_nav_inc_id"
let message_nav_dec_id = "panel_preferences_message_nav_dec_id"
let message_file_label_id = "panel_preferences_message_file_label"
Expand Down Expand Up @@ -276,14 +280,14 @@ module DivErrorMessage : Ui_common.Div = struct

let error_message =
Html.span
~a:[ Html.a_id id; Html.a_class [ "error-span" ] ]
~a:[ Html.a_id id_error; Html.a_class [ "error-span" ] ]
[ Tyxml_js.R.Html.txt error_message_text ]

let alert_messages =
Html.div
~a:
[
Html.a_id id;
Html.a_id id_alert;
Tyxml_js.R.Html.a_class
(React.S.bind (Hooked.S.to_react_signal State_error.errors)
(fun error ->
Expand Down
13 changes: 8 additions & 5 deletions gui/ui/panel_projects_controller.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@

open Lwt.Infix

let refresh r =
let r' = State_file.sync ~reset:true () in
let r'' = State_simulation.refresh () in
r' >>= fun r' ->
r'' >>= fun r'' -> Lwt.return (Api_common.result_combine [ r; r'; r'' ])
let refresh result_before =
let lwt_result_state_file_sync = State_file.sync ~reset:true () in
let lwt_result_simulation_refresh = State_simulation.refresh () in
lwt_result_state_file_sync >>= fun result_state_file_sync ->
lwt_result_simulation_refresh >>= fun result_simulation_refresh ->
Lwt.return
(Api_common.result_combine
[ result_before; result_state_file_sync; result_simulation_refresh ])

let create_project (project_id : string) : unit =
Common.async __LOC__ (fun () ->
Expand Down
2 changes: 1 addition & 1 deletion gui/ui/panel_tabs/tab_stories.ml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ let rec inspect_stories () =
>>= Result_util.fold
~ok:(fun is_computing ->
if is_computing && React.S.value tab_is_active then
Js_of_ocaml_lwt.Lwt_js.sleep 3. >>= inspect_stories
Js_of_ocaml_lwt.Lwt_js.sleep 1. >>= inspect_stories
else
Lwt.return_unit)
~error:(fun _ -> Lwt.return_unit)
Expand Down
Loading

0 comments on commit 13c4913

Please sign in to comment.