Skip to content

Commit

Permalink
Upgrade Deno version (#126)
Browse files Browse the repository at this point in the history
* Upgraded version.

* Removed deprecated

---------

Co-authored-by: Nigel Leck <[email protected]>
  • Loading branch information
nleck and nigelleck authored Aug 8, 2023
1 parent f29ae98 commit 4ebba71
Show file tree
Hide file tree
Showing 42 changed files with 61 additions and 57 deletions.
4 changes: 2 additions & 2 deletions src/Neat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import { addTag, getTag, removeTag } from "../src/tags/TagsInterface.ts";
import { fineTuneImprovement } from "./architecture/FineTune.ts";
import { makeElitists } from "../src/architecture/elitism.ts";
import { Network } from "./architecture/Network.ts";
import { ensureDirSync } from "https://deno.land/std@0.194.0/fs/ensure_dir.ts";
import { ensureDirSync } from "https://deno.land/std@0.197.0/fs/ensure_dir.ts";
import { Mutation } from "./methods/mutation.ts";
import { Selection } from "./methods/Selection.ts";
import { Offspring } from "./architecture/Offspring.ts";
import { NetworkUtil } from "./architecture/NetworkUtils.ts";
import { format } from "https://deno.land/std@0.194.0/fmt/duration.ts";
import { format } from "https://deno.land/std@0.197.0/fmt/duration.ts";

export class Neat {
readonly input: number;
Expand Down
6 changes: 3 additions & 3 deletions src/architecture/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import { make as makeConfig } from "../config/NeatConfig.ts";
import { NeatOptions } from "../config/NeatOptions.ts";
import { DataRecordInterface } from "./DataSet.ts";

import { yellow } from "https://deno.land/std@0.194.0/fmt/colors.ts";
import { yellow } from "https://deno.land/std@0.197.0/fmt/colors.ts";
import { Neat } from "../Neat.ts";
import { makeDataDir } from "../architecture/DataSet.ts";
import { WorkerHandler } from "../multithreading/workers/WorkerHandler.ts";
import { getTag } from "../tags/TagsInterface.ts";

import { format } from "https://deno.land/std@0.194.0/fmt/duration.ts";
import { emptyDirSync } from "https://deno.land/std@0.194.0/fs/empty_dir.ts";
import { format } from "https://deno.land/std@0.197.0/fmt/duration.ts";
import { emptyDirSync } from "https://deno.land/std@0.197.0/fs/empty_dir.ts";
import { CostInterface, Costs } from "../Costs.ts";
import { Node } from "../architecture/Node.ts";
import { findRatePolicy, randomPolicyName } from "../config.ts";
Expand Down
11 changes: 6 additions & 5 deletions src/architecture/NetworkUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { generate as generateV5 } from "https://deno.land/std@0.194.0/uuid/v5.ts";
import { generate as generateV5 } from "https://deno.land/std@0.197.0/uuid/v5.ts";
import { Network } from "./Network.ts";

export class NetworkUtil {
Expand Down Expand Up @@ -26,11 +26,12 @@ export class NetworkUtil {
delete c.trace;
},
);
delete json.tags;
delete json.uuid;
delete json.score;
const tmp = {
nodes: json.nodes,
connections: json.connections,
};

const txt = JSON.stringify(json, null, 1);
const txt = JSON.stringify(tmp);

const utf8 = NetworkUtil.TE.encode(txt);

Expand Down
2 changes: 1 addition & 1 deletion src/tags/TagAndReleaseApp.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse as parseArgs } from "https://deno.land/std@0.194.0/flags/mod.ts";
import { parse as parseArgs } from "https://deno.land/std@0.197.0/flags/mod.ts";
import { addTag } from "./TagsInterface.ts";

interface TagAndReleaseOptions {
Expand Down
7 changes: 5 additions & 2 deletions test/CRISPR.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
import {
assert,
assertEquals,
} from "https://deno.land/[email protected]/assert/mod.ts";

import { CRISPR } from "../src/reconstruct/CRISPR.ts";
import { Network } from "../src/architecture/Network.ts";
import { getTag } from "../src/tags/TagsInterface.ts";
import { Node } from "../src/architecture/Node.ts";
import { Mutation } from "../src/methods/mutation.ts";
import { assert } from "https://deno.land/[email protected]/_util/asserts.ts";

import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";

((globalThis as unknown) as { DEBUG: boolean }).DEBUG = true;
Expand Down
2 changes: 1 addition & 1 deletion test/Clipped.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";

import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
Expand Down
2 changes: 1 addition & 1 deletion test/Compact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
assert,
assertAlmostEquals,
fail,
} from "https://deno.land/std@0.194.0/testing/asserts.ts";
} from "https://deno.land/std@0.197.0/assert/mod.ts";

import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";

Expand Down
2 changes: 1 addition & 1 deletion test/Constant.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
assert,
assertAlmostEquals,
} from "https://deno.land/std@0.194.0/testing/asserts.ts";
} from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";

import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
Expand Down
2 changes: 1 addition & 1 deletion test/Correct.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertAlmostEquals } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assertAlmostEquals } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";

import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
Expand Down
2 changes: 1 addition & 1 deletion test/Costs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertAlmostEquals } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assertAlmostEquals } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Costs } from "../src/Costs.ts";
import { MSELimit } from "../src/costs/MSELimit.ts";
import { TwelveSteps } from "../src/costs/TwelveSteps.ts";
Expand Down
4 changes: 2 additions & 2 deletions test/CreatureStore.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { emptyDirSync } from "https://deno.land/std@0.194.0/fs/empty_dir.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { emptyDirSync } from "https://deno.land/std@0.197.0/fs/empty_dir.ts";
import { NeatOptions } from "../src/config/NeatOptions.ts";
import { Network } from "../src/architecture/Network.ts";

Expand Down
2 changes: 1 addition & 1 deletion test/Elitism.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { makeElitists } from "../src/architecture/elitism.ts";
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
import { Network } from "../src/architecture/Network.ts";

Expand Down
2 changes: 1 addition & 1 deletion test/Evolve.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Network } from "../src/architecture/Network.ts";
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Mutation } from "../src/methods/mutation.ts";

((globalThis as unknown) as { DEBUG: boolean }).DEBUG = true;
Expand Down
2 changes: 1 addition & 1 deletion test/ExperimentStore.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Neat } from "../src/Neat.ts";
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { addTag } from "../src/tags/TagsInterface.ts";
import { Network } from "../src/architecture/Network.ts";
import { NetworkUtil } from "../src/architecture/NetworkUtils.ts";
Expand Down
2 changes: 1 addition & 1 deletion test/FineTune.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { fineTuneImprovement } from "../src/architecture/FineTune.ts";
import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";
import { addTag } from "../src/tags/TagsInterface.ts";

Expand Down
2 changes: 1 addition & 1 deletion test/FineTuneUUID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
assertAlmostEquals,
assertEquals,
fail,
} from "https://deno.land/std@0.194.0/testing/asserts.ts";
} from "https://deno.land/std@0.197.0/assert/mod.ts";
import { fineTuneImprovement } from "../src/architecture/FineTune.ts";
import { Network } from "../src/architecture/Network.ts";

Expand Down
2 changes: 1 addition & 1 deletion test/Fix.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assertEquals } from "https://deno.land/std@0.197.0/assert/mod.ts";

import { Network } from "../src/architecture/Network.ts";
import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
Expand Down
2 changes: 1 addition & 1 deletion test/Hypot.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";

import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
Expand Down
2 changes: 1 addition & 1 deletion test/IfElse.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
assert,
assertAlmostEquals,
} from "https://deno.land/std@0.194.0/testing/asserts.ts";
} from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";

import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
Expand Down
2 changes: 1 addition & 1 deletion test/InConnections.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";

import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
Expand Down
2 changes: 1 addition & 1 deletion test/InFocus.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";
((globalThis as unknown) as { DEBUG: boolean }).DEBUG = true;

Expand Down
2 changes: 1 addition & 1 deletion test/Maximum.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";

import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
Expand Down
2 changes: 1 addition & 1 deletion test/Mean.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";

import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
Expand Down
2 changes: 1 addition & 1 deletion test/Minimum.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";

import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
Expand Down
4 changes: 2 additions & 2 deletions test/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import {
assertAlmostEquals,
assertEquals,
assertNotEquals,
} from "https://deno.land/std@0.194.0/testing/asserts.ts";
} from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";

import { emptyDirSync } from "https://deno.land/std@0.194.0/fs/empty_dir.ts";
import { emptyDirSync } from "https://deno.land/std@0.197.0/fs/empty_dir.ts";
import { DataRecordInterface } from "../src/architecture/DataSet.ts";
import { Offspring } from "../src/architecture/Offspring.ts";
import { NeatOptions } from "../src/config/NeatOptions.ts";
Expand Down
6 changes: 3 additions & 3 deletions test/NetworkUUID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
assert,
assertEquals,
assertNotEquals,
} from "https://deno.land/std@0.194.0/testing/asserts.ts";
} from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";
import { NetworkUtil } from "../src/architecture/NetworkUtils.ts";
import { Neat } from "../src/Neat.ts";
Expand Down Expand Up @@ -46,7 +46,7 @@ Deno.test("knownName", async () => {
console.log("UUID", uuid);

assert(
uuid == "5d82864b-dd93-55aa-af4a-0456ed67dd13",
uuid == "7750d0bf-6972-5e4b-92f5-1bbd9da220f7",
"Wrong UUID was: " + uuid,
);
});
Expand Down Expand Up @@ -132,7 +132,7 @@ Deno.test("ignoreTags", async () => {

/** Manually update if needed. */
assert(
uuid2 == "f5c7dea8-c1d9-51ed-b79f-22751f1d65de",
uuid2 == "91c2c15c-3ba4-52de-bf60-5c1c129875b2",
"Wrong UUID was: " + uuid2,
);
});
Expand Down
2 changes: 1 addition & 1 deletion test/NodeUUID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
import {
assert,
assertEquals,
} from "https://deno.land/std@0.194.0/testing/asserts.ts";
} from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";

((globalThis as unknown) as { DEBUG: boolean }).DEBUG = true;
Expand Down
2 changes: 1 addition & 1 deletion test/OffSpring.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Neat } from "../src/Neat.ts";
import { Network } from "../src/architecture/Network.ts";
import { Offspring } from "../src/architecture/Offspring.ts";
import { assertEquals } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assertEquals } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";

((globalThis as unknown) as { DEBUG: boolean }).DEBUG = true;
Expand Down
2 changes: 1 addition & 1 deletion test/Projection.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";

import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
Expand Down
2 changes: 1 addition & 1 deletion test/Ratios.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { NeatOptions } from "../src/config/NeatOptions.ts";
import { Network } from "../src/architecture/Network.ts";

Expand Down
2 changes: 1 addition & 1 deletion test/TagAndRelease.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assertEquals } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { TagAndRelease } from "../src/tags/TagAndReleaseApp.ts";
import { getTag } from "../src/tags/TagsInterface.ts";

Expand Down
2 changes: 1 addition & 1 deletion test/TagNode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";

import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
Expand Down
2 changes: 1 addition & 1 deletion test/Tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Network } from "../src/architecture/Network.ts";
import {
assert,
assertEquals,
} from "https://deno.land/std@0.194.0/testing/asserts.ts";
} from "https://deno.land/std@0.197.0/assert/mod.ts";
((globalThis as unknown) as { DEBUG: boolean }).DEBUG = true;

Deno.test("tag", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/TraceAggregate.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
assert,
assertAlmostEquals,
} from "https://deno.land/std@0.194.0/testing/asserts.ts";
} from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";
import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";

Expand Down
4 changes: 2 additions & 2 deletions test/TraceNode.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { emptyDirSync } from "https://deno.land/std@0.194.0/fs/empty_dir.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { emptyDirSync } from "https://deno.land/std@0.197.0/fs/empty_dir.ts";
import { NeatOptions } from "../src/config/NeatOptions.ts";
import { Network } from "../src/architecture/Network.ts";
import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
Expand Down
4 changes: 2 additions & 2 deletions test/TraceStore.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { emptyDirSync } from "https://deno.land/std@0.194.0/fs/empty_dir.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { emptyDirSync } from "https://deno.land/std@0.197.0/fs/empty_dir.ts";
import { NeatOptions } from "../src/config/NeatOptions.ts";
import { Network } from "../src/architecture/Network.ts";
import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
Expand Down
2 changes: 1 addition & 1 deletion test/Train.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Network } from "../src/architecture/Network.ts";
import { assert, fail } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert, fail } from "https://deno.land/std@0.197.0/assert/mod.ts";

((globalThis as unknown) as { DEBUG: boolean }).DEBUG = true;

Expand Down
2 changes: 1 addition & 1 deletion test/Worker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { WorkerHandler } from "../src/multithreading/workers/WorkerHandler.ts";

((globalThis as unknown) as { DEBUG: boolean }).DEBUG = true;
Expand Down
2 changes: 1 addition & 1 deletion test/addNode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";
import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";

Expand Down
4 changes: 2 additions & 2 deletions test/ifPropagation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { emptyDirSync } from "https://deno.land/std@0.194.0/fs/empty_dir.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { emptyDirSync } from "https://deno.land/std@0.197.0/fs/empty_dir.ts";
import { Network } from "../src/architecture/Network.ts";
import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
import { ConnectionTrace } from "../src/architecture/ConnectionInterfaces.ts";
Expand Down
2 changes: 1 addition & 1 deletion test/makeActivation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
assertAlmostEquals,
} from "https://deno.land/std@0.194.0/testing/asserts.ts";
} from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";
import { NetworkState } from "../src/architecture/NetworkState.ts";

Expand Down
2 changes: 1 addition & 1 deletion test/toJSON.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NetworkInternal } from "../src/architecture/NetworkInterfaces.ts";
import { assert } from "https://deno.land/std@0.194.0/testing/asserts.ts";
import { assert } from "https://deno.land/std@0.197.0/assert/mod.ts";
import { Network } from "../src/architecture/Network.ts";
import { ConnectionInternal } from "../src/architecture/ConnectionInterfaces.ts";

Expand Down

0 comments on commit 4ebba71

Please sign in to comment.