From b52bd751f83ed79ab742bfc29e40da46f87d916f Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Mon, 10 Jul 2023 12:15:42 +0200 Subject: [PATCH] fix: fix unresolved merge conflicts (#185) * fix: fix unresolved merge conflicts * docs: fix incorrectly formatted equations This commit fixes the incorrectly formatted equations. These were broken by the 'remark-lint' extension. The 'remark-math' extension was added to prevent this behavoir in the future. * build: pin npm versions --- .remarkrc | 3 +- package-lock.json | 96 +++++++++++++++++-- package.json | 11 ++- .../envs/biological/oscillator/README.md | 2 +- .../oscillator_complicated/README.md | 6 +- .../envs/classic_control/ex3_ekf/README.md | 6 +- stable_gym/envs/mujoco/ant_cost/README.md | 2 +- .../envs/mujoco/half_cheetah_cost/README.md | 6 +- stable_gym/envs/mujoco/swimmer_cost/README.md | 2 +- 9 files changed, 107 insertions(+), 27 deletions(-) diff --git a/.remarkrc b/.remarkrc index a81c42ee..fb19e09b 100644 --- a/.remarkrc +++ b/.remarkrc @@ -1,5 +1,6 @@ { "plugins": [ - "remark-preset-lint-recommended" + "remark-preset-lint-recommended", + "remark-math" ] } diff --git a/package-lock.json b/package-lock.json index c70e6126..609adac3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,24 +1,25 @@ { "name": "stable-gym", - "version": "0.7.0", + "version": "0.9.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "stable-gym", - "version": "0.7.0", + "version": "0.9.0", "license": "MIT", "devDependencies": { - "@commitlint/cli": "^17.6.5", - "@commitlint/config-conventional": "^17.6.5", - "commitizen": "^4.3.0", - "cz-conventional-changelog": "^3.3.0", - "husky": "^8.0.3", + "@commitlint/cli": "17.6.5", + "@commitlint/config-conventional": "17.6.5", + "commitizen": "4.3.0", + "cz-conventional-changelog": "3.3.0", + "husky": "8.0.3", "lint-staged": "13.2.2", "release-please": "github:rickstaa/release-please#add_pytoml_version_warning_ignore_ts", "remark": "14.0.3", "remark-cli": "11.0.0", "remark-lint": "9.1.2", + "remark-math": "5.1.1", "remark-preset-lint-recommended": "6.1.3", "sort-package-json": "2.5.0" } @@ -1138,6 +1139,12 @@ "integrity": "sha512-a3xgqnFTuNJDm1fjsTjHocYJ40Cz3t8utYpi5GNaxzrJC2HSD08ym+whIL7fNqiqBCdM9bcqD1H/tORWAFXoZw==", "dev": true }, + "node_modules/@types/katex": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@types/katex/-/katex-0.16.0.tgz", + "integrity": "sha512-hz+S3nV6Mym5xPbT9fnO8dDhBFQguMYpY0Ipxv06JMi1ORgnEM4M1ymWDUhUNer3ElLmT583opRo4RzxKmh9jw==", + "dev": true + }, "node_modules/@types/mdast": { "version": "3.0.11", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.11.tgz", @@ -3641,6 +3648,31 @@ "node": "*" } }, + "node_modules/katex": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.8.tgz", + "integrity": "sha512-ftuDnJbcbOckGY11OO+zg3OofESlbR5DRl2cmN8HeWeeFIV7wTXvAOx8kEjZjobhA+9wh2fbKeO6cdcA9Mnovg==", + "dev": true, + "funding": [ + "https://opencollective.com/katex", + "https://github.com/sponsors/katex" + ], + "dependencies": { + "commander": "^8.3.0" + }, + "bin": { + "katex": "cli.js" + } + }, + "node_modules/katex/node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -4217,6 +4249,21 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/mdast-util-math": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-math/-/mdast-util-math-2.0.2.tgz", + "integrity": "sha512-8gmkKVp9v6+Tgjtq6SYx9kGPpTf6FVYRa53/DLh479aldR9AyP48qeVOgNZ5X7QUK7nOy4yw7vg6mbiGcs9jWQ==", + "dev": true, + "dependencies": { + "@types/mdast": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-to-markdown": "^1.3.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/mdast-util-mdx-expression": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-1.3.2.tgz", @@ -4408,6 +4455,25 @@ "uvu": "^0.5.0" } }, + "node_modules/micromark-extension-math": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/micromark-extension-math/-/micromark-extension-math-2.1.2.tgz", + "integrity": "sha512-es0CcOV89VNS9wFmyn+wyFTKweXGW4CEvdaAca6SWRWPyYCbBisnjaHLjWO4Nszuiud84jCpkHsqAJoa768Pvg==", + "dev": true, + "dependencies": { + "@types/katex": "^0.16.0", + "katex": "^0.16.0", + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/micromark-factory-destination": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.0.0.tgz", @@ -6039,6 +6105,22 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/remark-math": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/remark-math/-/remark-math-5.1.1.tgz", + "integrity": "sha512-cE5T2R/xLVtfFI4cCePtiRn+e6jKMtFDR3P8V3qpv8wpKjwvHoBA4eJzvX+nVrnlNy0911bdGmuspCSwetfYHw==", + "dev": true, + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-math": "^2.0.0", + "micromark-extension-math": "^2.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/remark-message-control": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/remark-message-control/-/remark-message-control-7.1.1.tgz", diff --git a/package.json b/package.json index ea4ee1fe..b2091963 100644 --- a/package.json +++ b/package.json @@ -45,16 +45,17 @@ } }, "devDependencies": { - "@commitlint/cli": "^17.6.5", - "@commitlint/config-conventional": "^17.6.5", - "commitizen": "^4.3.0", - "cz-conventional-changelog": "^3.3.0", - "husky": "^8.0.3", + "@commitlint/cli": "17.6.5", + "@commitlint/config-conventional": "17.6.5", + "commitizen": "4.3.0", + "cz-conventional-changelog": "3.3.0", + "husky": "8.0.3", "lint-staged": "13.2.2", "release-please": "github:rickstaa/release-please#add_pytoml_version_warning_ignore_ts", "remark": "14.0.3", "remark-cli": "11.0.0", "remark-lint": "9.1.2", + "remark-math": "5.1.1", "remark-preset-lint-recommended": "6.1.3", "sort-package-json": "2.5.0" } diff --git a/stable_gym/envs/biological/oscillator/README.md b/stable_gym/envs/biological/oscillator/README.md index 0bb670f2..bb54345e 100644 --- a/stable_gym/envs/biological/oscillator/README.md +++ b/stable_gym/envs/biological/oscillator/README.md @@ -32,7 +32,7 @@ The agent's goal in the oscillator environment is to act in such a way that one The Oscillator environment uses the absolute difference between the reference and the state of interest as the cost function: $$ -cost = (p\_1 - r\_1)^2 +cost = (p_1 - r_1)^2 $$ ## Environment step return diff --git a/stable_gym/envs/biological/oscillator_complicated/README.md b/stable_gym/envs/biological/oscillator_complicated/README.md index d891c7c2..4939dfb9 100644 --- a/stable_gym/envs/biological/oscillator_complicated/README.md +++ b/stable_gym/envs/biological/oscillator_complicated/README.md @@ -34,9 +34,9 @@ The agent's goal in the oscillator environment is to act in such a way that one The Oscillator environment uses the absolute difference between the reference and the state of interest as the cost function: -```python -cost = np.square(p1 - r1) -``` +$$ +cost = (p_1 - r_1)^2 +$$ ## Environment step return diff --git a/stable_gym/envs/classic_control/ex3_ekf/README.md b/stable_gym/envs/classic_control/ex3_ekf/README.md index 94a4189e..ef3d9477 100644 --- a/stable_gym/envs/classic_control/ex3_ekf/README.md +++ b/stable_gym/envs/classic_control/ex3_ekf/README.md @@ -26,9 +26,9 @@ The agent's goal in the Ex3EKF environment is to act so that the estimator estim The Ex3EKF environment uses the following cost function: -```python -cost = np.square(hat_x_1 - x_1) + np.square(hat_x_2 - x_2) -``` +$$ +cost = (hat_x_1 - x_1)^2 + (hat_x_2 - x_2)^2 +$$ ## Environment step return diff --git a/stable_gym/envs/mujoco/ant_cost/README.md b/stable_gym/envs/mujoco/ant_cost/README.md index ab76810b..3c0c57ca 100644 --- a/stable_gym/envs/mujoco/ant_cost/README.md +++ b/stable_gym/envs/mujoco/ant_cost/README.md @@ -17,7 +17,7 @@ The rest of the environment is the same as the original Ant environment. Below, The cost function of this environment is designed in such a way that it tries to minimize the error between the Ant's forward velocity and a reference value. The cost function is defined as: $$ -cost = w\_{forward} \times (x\_{velocity} - x\_{reference\_x\_velocity})^2 + w\_{ctrl} \times c\_{ctrl} +cost = w_{forward} \times (x_{velocity} - x_{reference\_x\_velocity})^2 + w_{ctrl} \times c_{ctrl} $$ ## How to use diff --git a/stable_gym/envs/mujoco/half_cheetah_cost/README.md b/stable_gym/envs/mujoco/half_cheetah_cost/README.md index 390282fa..381242c2 100644 --- a/stable_gym/envs/mujoco/half_cheetah_cost/README.md +++ b/stable_gym/envs/mujoco/half_cheetah_cost/README.md @@ -1,11 +1,7 @@ # HalfCheetahCost gymnasium environment
-<<<<<<< HEAD Half Cheetah Cost -======= - Half Cheetah ->>>>>>> main

@@ -21,7 +17,7 @@ The rest of the environment is the same as the original HalfCheetah environment. The cost function of this environment is designed in such a way that it tries to minimize the error between the HalfCheetah's forward velocity and a reference value. The cost function is defined as: $$ -cost = w\_{forward} \times (x\_{velocity} - x\_{reference\_x\_velocity})^2 + w\_{ctrl} \times c\_{ctrl} +cost = w_{forward} \times (x_{velocity} - x_{reference\_x\_velocity})^2 + w_{ctrl} \times c_{ctrl} $$ ## How to use diff --git a/stable_gym/envs/mujoco/swimmer_cost/README.md b/stable_gym/envs/mujoco/swimmer_cost/README.md index 132b362d..08590579 100644 --- a/stable_gym/envs/mujoco/swimmer_cost/README.md +++ b/stable_gym/envs/mujoco/swimmer_cost/README.md @@ -16,7 +16,7 @@ The rest of the environment is the same as the original Swimmer environment. Bel The cost function of this environment is designed in such a way that it tries to minimize the error between the Swimmer's forward velocity and a reference value. The cost function is defined as: $$ -cost = w\_{forward} \times (x\_{velocity} - x\_{reference\_x\_velocity})^2 + w\_{ctrl} \times c\_{ctrl} +cost = w_{forward} \times (x_{velocity} - x_{reference\_x\_velocity})^2 + w_{ctrl} \times c_{ctrl} $$ ## How to use