Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0bd14a4
Updates scaladocs throughout (WIP)
PetrosPapapa Jul 29, 2022
5a3d5b9
Updates scaladoc of `Resource.scala`
PetrosPapapa Jul 29, 2022
3422f00
Adds `Scenario` and `Simulator` scaladocs
PetrosPapapa Jul 30, 2022
6c3bd28
Removes no longer needed `ResourceState.hasCapacity` tests
PetrosPapapa Jul 30, 2022
588601e
Moves `TestSim` to tests
PetrosPapapa Jul 30, 2022
192f10b
Scaladoc for `Task` and `Simulation` (WIP)
PetrosPapapa Jul 30, 2022
7fafc92
Adds/updates all state-related scaladoc
PetrosPapapa Jul 31, 2022
db602f7
Runs scalafmt
PetrosPapapa Jul 31, 2022
0171e1f
Fixes all scaladoc cross-link issues
PetrosPapapa Jul 31, 2022
1d89064
Updates scaladoc for proter-server
PetrosPapapa Jul 31, 2022
c0aa355
Moves matching resources test directly in `IRequest`
PetrosPapapa Jul 31, 2022
ab5b33c
Renames `Metrics.start` and `end` to `startTime` and `endTime`
PetrosPapapa Aug 1, 2022
9879ec7
Flattens JSON encoding of Maps in `Metrics`
PetrosPapapa Aug 1, 2022
5a421ab
Flattens JSON encoding of `MetricsException`
PetrosPapapa Aug 1, 2022
3866c9b
Flattens JSON encoding of `TaskInstance` maps in `JsonHandler`
PetrosPapapa Aug 1, 2022
7bcbd14
Completes OpenAPI spec
PetrosPapapa Aug 1, 2022
7f3021c
Improves `Simulator.stream` to ensure we get all the events through
PetrosPapapa Aug 1, 2022
1a7afe2
Adds small additions and improvements to the OpenAPI spec
PetrosPapapa Aug 1, 2022
2f3a1f1
Adds sbt-swagger-ui - to be tested
PetrosPapapa Aug 2, 2022
6abdac2
Reverts to a static swagger ui deployment
PetrosPapapa Aug 2, 2022
837ba9a
Updates docs config and front page with openapi links
PetrosPapapa Aug 2, 2022
f0aced2
Updates docs.org with server documentation
PetrosPapapa Aug 3, 2022
319e1b9
Makes progress in elements documentation up to Tasks
PetrosPapapa Aug 3, 2022
c400925
Moves `DiscreteEvent.scala` to its own `discrete` package
PetrosPapapa Aug 4, 2022
74cf33f
Adds documentation of `CaseRef` and `Case`
PetrosPapapa Aug 4, 2022
5ec6774
Fixes `Scenario` scaladoc
PetrosPapapa Oct 3, 2022
41c61a1
Adds documentation of `Scenario`
PetrosPapapa Oct 17, 2022
c02679f
Adds flag to prioritise tasks with `SortedSet`
PetrosPapapa Nov 20, 2022
025f39f
Updates and runs scalafmt
PetrosPapapa Nov 20, 2022
35313ac
Adds documentation for schedulers
PetrosPapapa Dec 26, 2022
ff3b407
Fixes brace typo in server api doc
PetrosPapapa Jan 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.0.5"
version = "3.6.1"
runner.dialect = scala3
maxColumn = 100
project.git = true
Expand All @@ -18,8 +18,8 @@ comments.wrap = trailing
spaces.beforeContextBoundColon = false
spaces.inImportCurlyBraces = true

optIn.blankLineBeforeDocstring = true
docstrings.forceBlankLineBefore = true
includeCurlyBraceInSelectChains = false
unindentTopLevelOperators = true

spaces.beforeContextBoundColon = Always
spaces.beforeContextBoundColon = Always
rewrite.trailingCommas.style = keep
6 changes: 4 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,17 @@ def proterModule(name: String): Project =
.settings(libraryDependencies ++= Dependencies.testAll)
.dependsOn(proter % "compile->compile;test->test")


lazy val root = Project(id = "proter-root", base = file("."))
.enablePlugins(ScalaUnidocPlugin)
.settings(commonSettings)
.settings(
publishArtifact := false,
ScalaUnidoc / siteSubdirName := "api",
addMappingsToSiteDir(ScalaUnidoc / packageDoc / mappings, ScalaUnidoc / siteSubdirName)
addMappingsToSiteDir(ScalaUnidoc / packageDoc / mappings, ScalaUnidoc / siteSubdirName),
)
.aggregate(aggregatedProjects: _*)
.enablePlugins(ScalaUnidocPlugin)


lazy val proter = Project(id = "proter", base = file("proter"))
.settings(commonSettings)
Expand Down
7 changes: 6 additions & 1 deletion docs/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ disableKinds = ["taxonomy", "taxonomyTerm"]
weight = 1000
url = "api/com/workflowfm/proter/"

[[menu.main]]
name = "OpenAPI"
weight = 2000
url = "server-api/"

[markup]
[markup.goldmark]
[markup.goldmark.renderer]
Expand All @@ -44,7 +49,7 @@ disableKinds = ["taxonomy", "taxonomyTerm"]
[params]

repo = "https://github.com/workflowfm/Proter"
version = "0.7.4"
version = "0.8"

time_format_blog = "Monday, 02 January 2006"
time_format_default = "2 January 2006"
Expand Down
8 changes: 5 additions & 3 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Proter"
author: ["Petros Papapanagiotou"]
lastmod: 2021-03-28T10:17:36+00:00
lastmod: 2022-08-02T23:05:36+00:00
draft: false
---

Expand All @@ -16,7 +16,7 @@ A [discrete event simulator](https://en.wikipedia.org/wiki/Discrete-event_simula
Proter is named after the first half of the Greek word *προτεραιότητα* (`pɾo.te.ɾeˈo.ti.ta`), meaning "priority".


{{< button "docs/" "Read the Docs" >}}{{< button "api/com/workflowfm/proter/" "API Documentation" >}}{{< button "https://github.com/workflowfm/Proter" "Source" >}}
{{< button "docs/" "Read the Docs" >}}{{< button "api/com/workflowfm/proter/" "API Documentation" >}}{{< button "https://github.com/workflowfm/Proter" "Source" >}}{{< button "server-api/" "Server OpenAPI" >}}


<a id="authors"></a>
Expand All @@ -32,6 +32,8 @@ Proter is named after the first half of the Greek word *προτεραιότητ
A big thank you to the following contributors in order of appearance:

- [Michal Baczun](https://github.com/MBaczun)
- [Martin Lewis](https://github.com/martin-lewis)



### Groups & Organizations
Expand Down Expand Up @@ -60,5 +62,5 @@ A big thank you to the following contributors in order of appearance:

Distributed under the Apache 2.0 license. See [LICENSE](https://github.com/workflowfm/Proter/blob/master/LICENSE) for more information.

Copyright &copy; 2019-2021 [The University of Edinburgh](https://www.ed.ac.uk/) and [contributors](#authors)
Copyright &copy; 2019-2022 [The University of Edinburgh](https://www.ed.ac.uk/) and [contributors](#authors)

629 changes: 604 additions & 25 deletions docs/org/docs.org

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions docs/static/css/workflowfm.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
.nomargin {
margin: 0;
}

code {
display: inline;
}

pre.chroma code {
display: block;
}

.tip_warning {
border-color: red;
}

strong {
font-weight: 900;
}

.icon_inline {
display: inline;
}

.icon_inline img.icon {
display: inline-block;
margin: 0;
}

.menu h3 {
padding-left: 5px;
}
.menu nav ul ul li {
padding-left: 8px;
}

14 changes: 14 additions & 0 deletions docs/static/server-api/absolute-path.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* getAbsoluteFSPath
* @return {string} When run in NodeJS env, returns the absolute path to the current directory
* When run outside of NodeJS, will return an error message
*/
const getAbsoluteFSPath = function () {
// detect whether we are running in a browser or nodejs
if (typeof module !== "undefined" && module.exports) {
return require("path").resolve(__dirname)
}
throw new Error('getAbsoluteFSPath can only be called within a Nodejs environment');
}

module.exports = getAbsoluteFSPath
Binary file added docs/static/server-api/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/static/server-api/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions docs/static/server-api/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
html {
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}

*,
*:before,
*:after {
box-sizing: inherit;
}

body {
margin: 0;
background: #fafafa;
}
40 changes: 40 additions & 0 deletions docs/static/server-api/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!-- HTML for static distribution bundle build --><!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="./swagger-ui.css">
<link rel="stylesheet" type="text/css" href="index.css">
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16">
</head>
<body>
<div id="swagger-ui"></div>
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
<script src="./swagger-initializer.js" charset="UTF-8">
window.onload = function() {
const ui = SwaggerUIBundle(
{


url: 'https://raw.githubusercontent.com/workflowfm/proter/fp-docs/proter-server/docs/proter-server-api.yaml',


deepLinking: true,
layout: 'StandaloneLayout',
dom_id: '#swagger-ui',
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
]
}
);
window.ui = ui;
};
</script>
</body>
</html>
17 changes: 17 additions & 0 deletions docs/static/server-api/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
try {
module.exports.SwaggerUIBundle = require("./swagger-ui-bundle.js")
module.exports.SwaggerUIStandalonePreset = require("./swagger-ui-standalone-preset.js")
} catch(e) {
// swallow the error if there's a problem loading the assets.
// allows this module to support providing the assets for browserish contexts,
// without exploding in a Node context.
//
// see https://github.com/swagger-api/swagger-ui/issues/3291#issuecomment-311195388
// for more information.
}

// `absolutePath` and `getAbsoluteFSPath` are both here because at one point,
// we documented having one and actually implemented the other.
// They were both retained so we don't break anyone's code.
module.exports.absolutePath = require("./absolute-path.js")
module.exports.getAbsoluteFSPath = require("./absolute-path.js")
79 changes: 79 additions & 0 deletions docs/static/server-api/oauth2-redirect.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!doctype html>
<html lang="en-US">
<head>
<title>Swagger UI: OAuth2 Redirect</title>
</head>
<body>
<script>
'use strict';
function run () {
var oauth2 = window.opener.swaggerUIRedirectOauth2;
var sentState = oauth2.state;
var redirectUrl = oauth2.redirectUrl;
var isValid, qp, arr;

if (/code|token|error/.test(window.location.hash)) {
qp = window.location.hash.substring(1);
} else {
qp = location.search.substring(1);
}

arr = qp.split("&");
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
qp = qp ? JSON.parse('{' + arr.join() + '}',
function (key, value) {
return key === "" ? value : decodeURIComponent(value);
}
) : {};

isValid = qp.state === sentState;

if ((
oauth2.auth.schema.get("flow") === "accessCode" ||
oauth2.auth.schema.get("flow") === "authorizationCode" ||
oauth2.auth.schema.get("flow") === "authorization_code"
) && !oauth2.auth.code) {
if (!isValid) {
oauth2.errCb({
authId: oauth2.auth.name,
source: "auth",
level: "warning",
message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
});
}

if (qp.code) {
delete oauth2.state;
oauth2.auth.code = qp.code;
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
} else {
let oauthErrorMsg;
if (qp.error) {
oauthErrorMsg = "["+qp.error+"]: " +
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
(qp.error_uri ? "More info: "+qp.error_uri : "");
}

oauth2.errCb({
authId: oauth2.auth.name,
source: "auth",
level: "error",
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
});
}
} else {
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
}
window.close();
}

if (document.readyState !== 'loading') {
run();
} else {
document.addEventListener('DOMContentLoaded', function () {
run();
});
}
</script>
</body>
</html>
Loading