repo_name stringlengths 1 62 | dataset stringclasses 1
value | lang stringclasses 11
values | pr_id int64 1 20.1k | owner stringlengths 2 34 | reviewer stringlengths 2 39 | diff_hunk stringlengths 15 262k | code_review_comment stringlengths 1 99.6k |
|---|---|---|---|---|---|---|---|
serl | github_2023 | python | 7 | rail-berkeley | youliangtan | @@ -0,0 +1,13 @@
+import numpy as np
+import gymnasium as gym
+
+from franka_env.envs.franka_env import FrankaEnv
+
+
+class FrankaPegInsert(FrankaEnv):
+ def __init__(self, **kwargs):
+ super().__init__(**kwargs)
+
+ def go_to_rest(self, jpos=False):
+ # TODO: Implement this
+ return NotImpl... | I noticed that go_to_rest is not impl here added this TODO. Not sure if this is giving an issue.
Also I make the workspace boundary configurable in the config class. Best if we can test it on the robot to ensure everything still works fine. |
serl | github_2023 | others | 6 | rail-berkeley | youliangtan | @@ -10,5 +10,5 @@ python async_drq_sim.py \
--utd_ratio 4 \
--batch_size 256 \
--eval_period 2000 \
- --encoder_type resnet \
+ --encoder_type resnet-pretrained \
--debug | one tip is to add in the bash script
```bash
python async_drq_sim.py "$@"
```
so this can support additional args that will arise in the future
```bash
bash run_actor.sh --other_args 99
``` |
serl | github_2023 | python | 6 | rail-berkeley | youliangtan | @@ -0,0 +1,399 @@
+#!/usr/bin/env python3
+
+# NOTE: this requires jaxrl_m to be installed:
+# https://github.com/rail-berkeley/jaxrl_minimal
+
+import time
+from functools import partial
+import jax
+import jax.numpy as jnp
+import numpy as np
+import tqdm
+from absl import app, flags
+from flax.training import ... | i assume these are part of the Charles PR? |
serl | github_2023 | python | 6 | rail-berkeley | youliangtan | @@ -0,0 +1,65 @@
+import gymnasium as gym
+from tqdm import tqdm
+import numpy as np
+import copy
+
+import franka_env
+
+from franka_env.envs.relative_env import RelativeFrame
+from franka_env.envs.wrappers import (
+ GripperCloseEnv,
+ SpacemouseIntervention,
+ Quat2EulerWrapper,
+)
+
+from serl_launcher.wra... | is this the utility script?
im okay for this to be part of the example. Just make it under `if __name__ == '__main__'` |
serl | github_2023 | others | 6 | rail-berkeley | youliangtan | @@ -0,0 +1,16 @@
+export XLA_PYTHON_CLIENT_PREALLOCATE=false && \
+export XLA_PYTHON_CLIENT_MEM_FRACTION=.2 && \
+python async_drq_randomized.py \
+ --learner \
+ --env FrankaRobotiqPegInsert-Vision-v0 \
+ --exp_name=serl_dev_drq_rlpd10demos_peg_insert_random_resnet_097 \
+ --seed 0 \
+ --random_steps 10... | hard coded `checkpoint_path` |
serl | github_2023 | python | 6 | rail-berkeley | youliangtan | @@ -0,0 +1,399 @@
+#!/usr/bin/env python3
+
+# NOTE: this requires jaxrl_m to be installed:
+# https://github.com/rail-berkeley/jaxrl_minimal
+
+import time
+from functools import partial
+import jax
+import jax.numpy as jnp
+import numpy as np
+import tqdm
+from absl import app, flags
+from flax.training import ... | since we are not providing multithreaded example, feel free to remove those that uses `tunnel` or docs that mention it.
FYI, in the edgeml library, the term `tunnel` refers to the shared datastore when using multi threading. |
serl | github_2023 | python | 6 | rail-berkeley | youliangtan | @@ -0,0 +1,399 @@
+#!/usr/bin/env python3
+
+# NOTE: this requires jaxrl_m to be installed:
+# https://github.com/rail-berkeley/jaxrl_minimal
+
+import time
+from functools import partial
+import jax
+import jax.numpy as jnp
+import numpy as np
+import tqdm
+from absl import app, flags
+from flax.training import ... | should we rename this term `utd_ratio`? As UTD means updates to data ratio, and this might be confusing as we are doing a different thing here. |
serl | github_2023 | python | 4 | rail-berkeley | youliangtan | @@ -151,12 +151,13 @@ def sample(
obs_pixels, self._num_stack + 1, axis=0
)
obs_pixels = obs_pixels[indx - self._num_stack]
+ obs_pixels = obs_pixels.transpose((0, 4, 1, 2, 3)) | Add comment on this transpose seq
|
serl | github_2023 | python | 4 | rail-berkeley | youliangtan | @@ -0,0 +1,359 @@
+#!/usr/bin/env python3
+
+# NOTE: this requires jaxrl_m to be installed:
+# https://github.com/rail-berkeley/jaxrl_minimal
+
+import time
+from functools import partial
+import jax
+import jax.numpy as jnp
+import numpy as np
+import tqdm
+from absl import app, flags
+
+import gymnasium as gym
... | instead of having 2 args, we can just keep `replay_buffer` as a single arg, initiate the iterator within the `learner()` function. cleaner |
serl | github_2023 | python | 4 | rail-berkeley | youliangtan | @@ -0,0 +1,359 @@
+#!/usr/bin/env python3
+
+# NOTE: this requires jaxrl_m to be installed:
+# https://github.com/rail-berkeley/jaxrl_minimal
+
+import time
+from functools import partial
+import jax
+import jax.numpy as jnp
+import numpy as np
+import tqdm
+from absl import app, flags
+
+import gymnasium as gym
... | Curiously, is this `done` redundant? or do we have this as truncated? |
serl | github_2023 | python | 4 | rail-berkeley | youliangtan | @@ -0,0 +1,396 @@
+#!/usr/bin/env python3
+
+# NOTE: this requires jaxrl_m to be installed:
+# https://github.com/rail-berkeley/jaxrl_minimal
+
+import time
+from functools import partial
+import jax
+import jax.numpy as jnp
+import numpy as np
+import tqdm
+from absl import app, flags
+
+import gymnasium as gym
... | similar to above |
serl | github_2023 | python | 4 | rail-berkeley | youliangtan | @@ -0,0 +1,396 @@
+#!/usr/bin/env python3
+
+# NOTE: this requires jaxrl_m to be installed:
+# https://github.com/rail-berkeley/jaxrl_minimal
+
+import time
+from functools import partial
+import jax
+import jax.numpy as jnp
+import numpy as np
+import tqdm
+from absl import app, flags
+
+import gymnasium as gym
... | The `demo_buffer` can be added within the `learner()` function. Also, it is preferable to make `franka_lift_cube_image_20_trajs.pkl"` configurable |
serl | github_2023 | python | 4 | rail-berkeley | youliangtan | @@ -0,0 +1,359 @@
+#!/usr/bin/env python3
+
+# NOTE: this requires jaxrl_m to be installed:
+# https://github.com/rail-berkeley/jaxrl_minimal
+
+import time
+from functools import partial
+import jax
+import jax.numpy as jnp
+import numpy as np
+import tqdm
+from absl import app, flags
+
+import gymnasium as gym
... | i think with the change of `learner()` args, this multithreaded option is no longer working. either we remove this, or support this. same to other examples. |
serl | github_2023 | python | 3 | rail-berkeley | youliangtan | @@ -0,0 +1,19 @@
+from setuptools import setup
+
+setup(
+ name="edgeml",
+ version="0.1.2", | `serl_launcher` package |
serl | github_2023 | python | 3 | rail-berkeley | youliangtan | @@ -0,0 +1,19 @@
+from setuptools import setup
+
+setup(
+ name="edgeml",
+ version="0.1.2",
+ description="library to enable distributed edge ml training and inference",
+ url="https://github.com/youliangtan/edgeml",
+ author="auth",
+ author_email="tan_you_liang@hotmail.com",
+ license="MIT",
+ ... | Since Iam maintaining `edgeml`, so it is better not to duplicate code
```py
install_requires=[
....... TODO DEPENDENCIES
"'edgeml @ git+https://github.com/youliangtan/edgeml.git@COMMIT_HASH',
],
``` |
serl | github_2023 | others | 3 | rail-berkeley | youliangtan | @@ -3,5 +3,36 @@

## Installation
-- Conda Environment:
+1. Conda Environment:
- create an environment with `conda create -n serl python=3.10`
+
+2. Install RL library
+ - the examples here use jaxrl-minimal as the RL library.
+ - T... | I see no diff in `serl_dev` and `main` in `jaxrl_minimal`, is that what it suppose to? |
serl | github_2023 | python | 3 | rail-berkeley | youliangtan | @@ -0,0 +1,195 @@
+from functools import partial | This seems to be similar to the one in `jaxrl_m`. If there's diff, place it in `serl_dev`, or keep it here for now (both options are good) |
serl | github_2023 | python | 3 | rail-berkeley | youliangtan | @@ -0,0 +1,162 @@
+import copy
+from typing import Iterable, Optional, Tuple
+
+import gymnasium as gym
+import numpy as np
+from edgeml.data.serl_dataset import DatasetDict, _sample
+from edgeml.data.serl_replay_buffer import ReplayBuffer
+from flax.core import frozen_dict
+from gymnasium.spaces import Box
+
+ | Since this package is now call `serl_launcher`, the path should be:
```bash
serl_launcher/serl_launcher/data/memory_efficient_replay_buffer.py
```
|
serl | github_2023 | others | 1 | rail-berkeley | youliangtan | @@ -0,0 +1,5 @@
+# SERL: A Software Suite for Sample-Efficient Robotic Reinforcement Learning
+
+## Installation
+- Conda Environment:
+ - create an environment with `conda create -n serl_dev python=3.10` | use `serl` as conda env name |
bridge_data_v2 | github_2023 | others | 9 | rail-berkeley | HomerW | @@ -36,26 +36,46 @@ python experiments/train.py \
--name NAME
```
+
Training hyperparameters can be modified in `experiments/configs/data_config.py` and data parameters (e.g. subsets to include/exclude) can be modified in `experiments/configs/train_config.py`.
## Evaluation
-First, set up the robot hardw... | ```suggestion
To evaluate image-conditioned or language-conditioned methods, run `eval_gc.py` or `eval_lc.py` respectively in the docker container. (Refer to the [bridge_data_robot](https://github.com/rail-berkeley/bridge_data_robot) docs)
``` |
bridge_data_v2 | github_2023 | others | 9 | rail-berkeley | HomerW | @@ -36,26 +36,46 @@ python experiments/train.py \
--name NAME
```
+
Training hyperparameters can be modified in `experiments/configs/data_config.py` and data parameters (e.g. subsets to include/exclude) can be modified in `experiments/configs/train_config.py`.
## Evaluation
-First, set up the robot hardw... | ```suggestion
Optionally, you can run the `eval.py` which uses our newer `WidowXClient` API. With this setup, the robot is run as a server that receives actions and the policy acts as a client that sends actions. This "server-client" architecture allows us to both isolate robot controller and policy dependencies, as w... |
bridge_data_v2 | github_2023 | others | 9 | rail-berkeley | HomerW | @@ -36,26 +36,46 @@ python experiments/train.py \
--name NAME
```
+
Training hyperparameters can be modified in `experiments/configs/data_config.py` and data parameters (e.g. subsets to include/exclude) can be modified in `experiments/configs/train_config.py`.
## Evaluation
-First, set up the robot hardw... | ```suggestion
export CHECKPOINT_DIR=/path/to/checkpoint_dir
``` |
bridge_data_v2 | github_2023 | others | 9 | rail-berkeley | HomerW | @@ -36,26 +36,46 @@ python experiments/train.py \
--name NAME
```
+
Training hyperparameters can be modified in `experiments/configs/data_config.py` and data parameters (e.g. subsets to include/exclude) can be modified in `experiments/configs/train_config.py`.
## Evaluation
-First, set up the robot hardw... | ```suggestion
python experiments/eval.py \
``` |
bridge_data_v2 | github_2023 | others | 9 | rail-berkeley | HomerW | @@ -36,26 +36,46 @@ python experiments/train.py \
--name NAME
```
+
Training hyperparameters can be modified in `experiments/configs/data_config.py` and data parameters (e.g. subsets to include/exclude) can be modified in `experiments/configs/train_config.py`.
## Evaluation
-First, set up the robot hardw... | ```suggestion
python experiments/eval.py \
``` |
bridge_data_v2 | github_2023 | others | 9 | rail-berkeley | HomerW | @@ -36,26 +36,46 @@ python experiments/train.py \
--name NAME
```
+
Training hyperparameters can be modified in `experiments/configs/data_config.py` and data parameters (e.g. subsets to include/exclude) can be modified in `experiments/configs/train_config.py`.
## Evaluation
-First, set up the robot hardw... | ```suggestion
--im_size 256 --goal_type gc --show_image --blocking
``` |
bridge_data_v2 | github_2023 | others | 9 | rail-berkeley | HomerW | @@ -36,26 +36,46 @@ python experiments/train.py \
--name NAME
```
+
Training hyperparameters can be modified in `experiments/configs/data_config.py` and data parameters (e.g. subsets to include/exclude) can be modified in `experiments/configs/train_config.py`.
## Evaluation
-First, set up the robot hardw... | ```suggestion
--im_size 256 --goal_type lc --show_image --blocking
``` |
bridge_data_v2 | github_2023 | python | 9 | rail-berkeley | HomerW | @@ -0,0 +1,385 @@
+#!/usr/bin/env python3
+
+import sys
+import os
+import time
+from datetime import datetime
+import traceback
+from collections import deque
+import json
+
+from absl import app, flags, logging
+
+import numpy as np
+import tensorflow as tf
+
+import cv2
+import jax
+from PIL import Image
+import ima... | Can you convert `obs["full_image"]` to BGR channel order here so that it's displayed correctly? (open-cv uses BGR channel order while our images are RGB) |
bridge_data_v2 | github_2023 | python | 9 | rail-berkeley | HomerW | @@ -0,0 +1,385 @@
+#!/usr/bin/env python3
+
+import sys
+import os
+import time
+from datetime import datetime
+import traceback
+from collections import deque
+import json
+
+from absl import app, flags, logging
+
+import numpy as np
+import tensorflow as tf
+
+import cv2
+import jax
+from PIL import Image
+import ima... | Can we make `eval_lc.py` and `eval_gc.py` also have default `goal_eep` and default `initial_eep` of `[0.3, 0.0, 0.15]`? Though maybe not too important if we plan to deprecate them anyway. |
smods | github_2023 | others | 580 | Steamodded | english5040 | @@ -152,12 +152,12 @@ function SMODS.calculate_retriggers(card, context, _ret) end
---@return table[] reps
function SMODS.calculate_repetitions(card, context, reps) end
+---@param blueprint_card Card|table
---@param card Card|table
----@param blueprint_card Card|table
---@param context CalcContext|table
---@ret... | I don't really like the original description- something like "Helper function to copy the ability of another joker. Useful for implementing Blueprint-like jokers" would be more clear.
The current description makes it sound like this function is a calculation step, which it isn't. |
smods | github_2023 | others | 428 | Steamodded | Eremel | @@ -2261,81 +2298,199 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
----- API CODE GameObject.DeckSkin
-------------------------------------------------------------------------------------------------
- local deck_skin_count_by_suit = {}
SMODS.DeckSkins = {}
- ... | Needs some sort of default value otherwise palettes that are missing it become the default card textures, |
smods | github_2023 | others | 428 | Steamodded | Eremel | @@ -982,7 +982,78 @@ SMODS.find_mod = function(id)
return ret
end
+local function bufferCardLimitForSmallDS(cards, scaleFactor)
+ local cardCount = #cards
+ if type(scaleFactor) ~= "number" or scaleFactor <= 0 then
+ sendWarnMessage("scaleFactor must be a positive number")
+ return cardCount... | Needs a `not skin.outdated` check |
smods | github_2023 | others | 428 | Steamodded | Eremel | @@ -982,7 +982,78 @@ SMODS.find_mod = function(id)
return ret
end
+local function bufferCardLimitForSmallDS(cards, scaleFactor)
+ local cardCount = #cards
+ if type(scaleFactor) ~= "number" or scaleFactor <= 0 then
+ sendWarnMessage("scaleFactor must be a positive number")
+ return cardCount... | This function doesn't allow custom colours on High Contrast and Low Contrast skins. |
smods | github_2023 | others | 428 | Steamodded | Eremel | @@ -780,6 +791,40 @@ function G.UIDEF.deck_preview(args)
return t
end
+function tally_sprite(pos, value, tooltip, suit)
+ local text_colour = G.C.BLACK
+ if type(value) == "table" and value[1].string==value[2].string then
+ text_colour = value[1].colour or G.C.WHITE
+ value = value[1].string
+ end
+ local decksk... | This line crashes when viewing the deck |
smods | github_2023 | others | 480 | Steamodded | WilsontheWolf | @@ -0,0 +1,446 @@
+SMODS.DrawSteps = {}
+SMODS.DrawStep = SMODS.GameObject:extend {
+ obj_table = SMODS.DrawSteps,
+ obj_buffer = {},
+ required_params = {
+ 'key',
+ 'order',
+ 'func',
+ },
+ layers = {
+ card = true,
+ both = true,
+ },
+ -- func = function(card... | Could we do the no_shadow and shadows on check earlier in this function to avoid doing some extra work we don't need to? |
smods | github_2023 | others | 480 | Steamodded | WilsontheWolf | @@ -0,0 +1,446 @@
+SMODS.DrawSteps = {}
+SMODS.DrawStep = SMODS.GameObject:extend {
+ obj_table = SMODS.DrawSteps,
+ obj_buffer = {},
+ required_params = {
+ 'key',
+ 'order',
+ 'func',
+ },
+ layers = {
+ card = true,
+ both = true,
+ },
+ -- func = function(card... | Should we make a property that allows other cards to be able to get this behviour? |
smods | github_2023 | others | 480 | Steamodded | WilsontheWolf | @@ -0,0 +1,446 @@
+SMODS.DrawSteps = {}
+SMODS.DrawStep = SMODS.GameObject:extend {
+ obj_table = SMODS.DrawSteps,
+ obj_buffer = {},
+ required_params = {
+ 'key',
+ 'order',
+ 'func',
+ },
+ layers = {
+ card = true,
+ both = true,
+ },
+ -- func = function(card... | Same as above for invisible joker |
smods | github_2023 | others | 480 | Steamodded | WilsontheWolf | @@ -0,0 +1,446 @@
+SMODS.DrawSteps = {}
+SMODS.DrawStep = SMODS.GameObject:extend {
+ obj_table = SMODS.DrawSteps,
+ obj_buffer = {},
+ required_params = {
+ 'key',
+ 'order',
+ 'func',
+ },
+ layers = {
+ card = true,
+ both = true,
+ },
+ -- func = function(card... | ```suggestion
local seal = G.P_SEALS[self.seal] or {}
```
I don't believe that is nessicary |
smods | github_2023 | others | 480 | Steamodded | WilsontheWolf | @@ -0,0 +1,446 @@
+SMODS.DrawSteps = {}
+SMODS.DrawStep = SMODS.GameObject:extend {
+ obj_table = SMODS.DrawSteps,
+ obj_buffer = {},
+ required_params = {
+ 'key',
+ 'order',
+ 'func',
+ },
+ layers = {
+ card = true,
+ both = true,
+ },
+ -- func = function(card... | Same as the others above although this one seems less likely to want to be used |
smods | github_2023 | others | 480 | Steamodded | WilsontheWolf | @@ -0,0 +1,446 @@
+SMODS.DrawSteps = {}
+SMODS.DrawStep = SMODS.GameObject:extend {
+ obj_table = SMODS.DrawSteps,
+ obj_buffer = {},
+ required_params = {
+ 'key',
+ 'order',
+ 'func',
+ },
+ layers = {
+ card = true,
+ both = true,
+ },
+ -- func = function(card... | Putting this here as it's where I thought of it but it might be nice to add a propert to the draw step to skip this step in certain conditions. Something like
```lua
skip = {
vortex = true,
front = true,
}
```
which would just be equivalent to putting the code in a big old
```lua
if not self.vortex and sel... |
smods | github_2023 | others | 480 | Steamodded | WilsontheWolf | @@ -0,0 +1,446 @@
+SMODS.DrawSteps = {}
+SMODS.DrawStep = SMODS.GameObject:extend {
+ obj_table = SMODS.DrawSteps,
+ obj_buffer = {},
+ required_params = {
+ 'key',
+ 'order',
+ 'func',
+ },
+ layers = {
+ card = true,
+ both = true,
+ },
+ -- func = function(card... | Same as the other's |
smods | github_2023 | others | 480 | Steamodded | WilsontheWolf | @@ -0,0 +1,446 @@
+SMODS.DrawSteps = {}
+SMODS.DrawStep = SMODS.GameObject:extend {
+ obj_table = SMODS.DrawSteps,
+ obj_buffer = {},
+ required_params = {
+ 'key',
+ 'order',
+ 'func',
+ },
+ layers = {
+ card = true,
+ both = true,
+ },
+ -- func = function(card... | This code would probably be cleaner with a table to lookup in and then mods could also add their own values to the table to not be drawn here if they want their own step. |
smods | github_2023 | others | 480 | Steamodded | WilsontheWolf | @@ -0,0 +1,446 @@
+SMODS.DrawSteps = {}
+SMODS.DrawStep = SMODS.GameObject:extend {
+ obj_table = SMODS.DrawSteps,
+ obj_buffer = {},
+ required_params = {
+ 'key',
+ 'order',
+ 'func',
+ },
+ layers = {
+ card = true,
+ both = true,
+ },
+ -- func = function(card... | Why do these need 2 different priorities? |
smods | github_2023 | others | 480 | Steamodded | GauntletGames-2086 | @@ -0,0 +1,453 @@
+SMODS.DrawSteps = {}
+SMODS.DrawStep = SMODS.GameObject:extend {
+ obj_table = SMODS.DrawSteps,
+ obj_buffer = {},
+ required_params = {
+ 'key',
+ 'order',
+ 'func',
+ },
+ layers = {
+ card = true,
+ both = true,
+ },
+ -- func = function(card... | This and the Hologram checks should be swapped, so in the edgecase of someone taking ownership of Hologram to change the soul sprite `soul_pos.draw` is respected. |
smods | github_2023 | others | 399 | Steamodded | srockw | @@ -0,0 +1,407 @@
+---@meta
+
+--- Util Classes
+
+--- Internal class referring args passed as `context` in a SMODS object's `calculate` function.
+--- Not all arguments typed here are present in all contexts, see [Calculate Function](https://github.com/Steamodded/smods/wiki/calculate_functions#contexts) for details. ... | Should be `remove_playing_cards` |
smods | github_2023 | others | 399 | Steamodded | srockw | @@ -0,0 +1,439 @@
+---@meta
+
+--- Util Classes
+
+--- Internal class referring args passed as `context` in a SMODS object's `calculate` function.
+--- Not all arguments typed here are present in all contexts, see [Calculate Function](https://github.com/Steamodded/smods/wiki/calculate_functions#contexts) for details. ... | is actually `consumeable` |
smods | github_2023 | others | 355 | Steamodded | MathIsFun0 | @@ -908,6 +950,240 @@ SMODS.find_mod = function(id)
return ret
end
+
+
+-- This function handles the calculation of each effect returned to evaluate play.
+-- Can easily be hooked to add more calculation effects ala Talisman
+SMODS.calculate_individual_effect = function(effect, scored_card, percent, key, amount... | This is where the actual retriggering is, so context.retrigger_joker should be what is set to true here. |
smods | github_2023 | others | 285 | Steamodded | Aurelius7309 | @@ -0,0 +1,119 @@
+[manifest]
+version = "1.0.0"
+dump_lua = true
+priority = 0
+
+#========================================================#
+# Choose any rank for custom deck and use provided atlas #
+#========================================================#
+[[patches]]
+[patches.regex]
+target = "functions/misc_fu... | Using `pairs` here causes the suits to be out of order, I'd use `ipairs(SMODS.Suit:obj_list(true))` to be fully consistent |
smods | github_2023 | others | 285 | Steamodded | Aurelius7309 | @@ -0,0 +1,119 @@
+[manifest]
+version = "1.0.0"
+dump_lua = true
+priority = 0
+
+#========================================================#
+# Choose any rank for custom deck and use provided atlas #
+#========================================================#
+[[patches]]
+[patches.regex]
+target = "functions/misc_fu... | There's a crash when selecting a custom suit with no deck skins registered for that suit (apparently due to some localization entries missing). Tested with Bunco |
smods | github_2023 | others | 285 | Steamodded | Aurelius7309 | @@ -0,0 +1,119 @@
+[manifest]
+version = "1.0.0"
+dump_lua = true
+priority = 0
+
+#========================================================#
+# Choose any rank for custom deck and use provided atlas #
+#========================================================#
+[[patches]]
+[patches.regex]
+target = "functions/misc_fu... | Steamodded wants to preserve the behavior of the game for aspects that other mods don't actively change. As such, I can't approve always putting all ranks on display. At the very least the vanilla collabs should only display the face cards they're changing. Maybe you could make use of the `ranks` table to respect that? |
smods | github_2023 | others | 314 | Steamodded | WilsontheWolf | @@ -55,7 +55,7 @@ function loadMods(modsDirectory)
},
prefix = { pattern = '%-%-%- PREFIX: (.-)\n' },
version = { pattern = '%-%-%- VERSION: (.-)\n', handle = function(x) return x and V(x):is_valid() and x or '0.0.0' end },
- outdated = { pattern = { 'SMODS%.INIT', 'S... | the %. is nessicary as . represents any character, and the % escapes it |
smods | github_2023 | others | 243 | Steamodded | Aurelius7309 | @@ -7,32 +7,47 @@ priority = 0
# Card:open
[[patches]]
-[patches.pattern]
+[patches.regex]
target = "card.lua"
-pattern = '''G.GAME.pack_choices = self.config.center.config.choose or 1'''
+pattern = '''(?<indent>[\t ]*)if self\.ability\.name:find\('Arcana'\) then \n[\s\S]{12}G\.STATE'''
position = "before"
paylo... | This causes no issues if done correctly, as the function can be hooked with access to the pre-existing version, changing parts of the return value as necessary. Conflicts, should they occur, are decided by loading priority. |
smods | github_2023 | others | 206 | Steamodded | Aurelius7309 | @@ -0,0 +1,459 @@
+--- STEAMODDED HEADER
+--- MOD_NAME: Vanilla SMODS
+--- MOD_ID: VSMODS
+--- MOD_AUTHOR: [someone23832]
+--- MOD_DESCRIPTION: Turns some vanilla jokers into an SMODS format, and changes them to give some examples of what you can do.
+--- LOADER_VERSION_GEQ: 1.0.0
+--- BADGE_COLOR: c7638f
+--- PREFIX: ... | These functions are duplicates; `config.extra.d_size` and `h_size` apply these automatically. So this is actually oversaturated Merry Andy |
smods | github_2023 | others | 217 | Steamodded | english5040 | @@ -1939,40 +1939,57 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
----- API CODE GameObject.PokerHand
-------------------------------------------------------------------------------------------------
+ SMODS.PokerHandParts = {}
+ SMODS.PokerHandPart = SMODS.GameO... | I support this, since it was confusing. Reminder that we should warn people about this |
smods | github_2023 | others | 217 | Steamodded | english5040 | @@ -1939,40 +1939,57 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
----- API CODE GameObject.PokerHand
-------------------------------------------------------------------------------------------------
+ SMODS.PokerHandParts = {}
+ SMODS.PokerHandPart = SMODS.GameO... | An idea I had for poker hands: auto-sort them based on the product of base mult/chips; above_hand (if set) should be considered first. If two hands are both set to be above the same hand, there could also be conflicts? |
smods | github_2023 | others | 217 | Steamodded | english5040 | @@ -1986,6 +2003,70 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
inject = function(self) end
}
+ SMODS.PokerHandPart {
+ key = '_highest',
+ func = function(hand) return get_highest(hand) end
+ }
+ SMODS.PokerHandPart {
+ key = '_strai... | A bit misleading to call this _fh if it's not necessarily a full house
Edit: yeah, if it's called _fh people might use it when it's just a pair. something like all_pairs or something might be better |
smods | github_2023 | others | 207 | Steamodded | Aurelius7309 | @@ -323,7 +324,7 @@ function buildAdditionsTab(mod)
local modNodes = {}
table.insert(modNodes, t)
- return {
+ return (#leftside_nodes > 0 and #rightside_nodes > 0 ) and { | This doesn't seem right...? It's possible for one column to be empty and the tab should still show |
smods | github_2023 | others | 207 | Steamodded | Aurelius7309 | @@ -2148,9 +2146,85 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
SMODS.process_loc_text(G.localization.descriptions.Other, self.key, self.loc_txt, 'description')
SMODS.process_loc_text(G.localization.misc.labels, self.key, self.loc_txt, 'label')
... | `sticker_check = nil` does nothing, it acts like there is no value there. Use 0 or false instead. Though the base checks should work here? |
smods | github_2023 | others | 207 | Steamodded | Aurelius7309 | @@ -494,6 +527,157 @@ G.UIDEF.consumable_collection_page = function(page)
return t
end
+G.FUNCS.your_collection_stickers = function(e)
+ G.SETTINGS.paused = true
+ G.FUNCS.overlay_menu{
+ definition = create_UIBox_your_collection_stickers(),
+ }
+end
+
+function create_UIBox_your_collection_stickers(exit)
+ loca... | Missing 'end' here |
smods | github_2023 | others | 212 | Steamodded | Aurelius7309 | @@ -584,3 +584,43 @@ function format_ui_value(value)
end
--#endregion
+
+
+function poll_seal(_key, _mod, _guaranteed, _options, _type_key) | Consistency, this should be `SMODS.poll_seal`. API design, this has too many arguments. I suggest converting to a table argument that can hold these arguments as needed |
smods | github_2023 | others | 212 | Steamodded | Aurelius7309 | @@ -584,3 +584,43 @@ function format_ui_value(value)
end
--#endregion
+
+
+function poll_seal(_key, _mod, _guaranteed, _options, _type_key)
+ _mod = _mod or 1
+ local seal_poll = pseudorandom(pseudoseed(_key or 'stdseal'..G.GAME.round_resets.ante))
+ -- If no _options provided, get all seal keys
+ if no... | In reference to #155, this should expose the same `get_weight` function that editions do. |
smods | github_2023 | others | 212 | Steamodded | Aurelius7309 | @@ -9,15 +9,35 @@ priority = 0
[patches.regex]
target = 'card.lua'
pattern = '''
-(?<indent>[\t ]*)if seal_type > 0.75 then card:set_seal\('Red'\)
-[\t ]*elseif seal_type > 0.5 then card:set_seal\('Blue'\)
-[\t ]*elseif seal_type > 0.25 then card:set_seal\('Gold'\)
-[\t ]*else card:set_seal\('Purple'\)
-[\t ]*end'''... | Consistency: why does this exclude modded seals? |
smods | github_2023 | others | 212 | Steamodded | Aurelius7309 | @@ -179,4 +199,32 @@ position = "after"
payload = '''
elseif self.children.alert and self.seal and not G.P_SEALS[self.seal].alerted then
G.P_SEALS[self.seal].alerted = true
- G:save_progress()'''
\ No newline at end of file
+ G:save_progress()'''
+
+# Game:init_item_prototyp... | Invalidates `order`, can we change the order on P_SEALS directly? |
smods | github_2023 | others | 202 | Steamodded | english5040 | @@ -395,6 +395,21 @@ function modsCollectionTally(pool, set)
return obj_tally
end
+function math.round(num, precision)
+ precision = 10^(precision or 0)
+
+ return math.floor(num * precision + 0.49999999999999994) / precision | I advise not overwriting stuff in the math namespace (liable to lead to incompatibilities, misleading because it's not in standard library).
If possible, is there a way you could make this more mathematically precise? I understand if you can't |
smods | github_2023 | others | 202 | Steamodded | english5040 | @@ -0,0 +1,70 @@
+[manifest]
+version = "1.0.0"
+dump_lua = true
+priority = 0
+
+
+#
+# End of round money
+#
+
+# Hide off screen rows
+
+[[patches]]
+[patches.pattern]
+target = "functions/common_events.lua"
+pattern = "if config.name ~= 'bottom' then"
+position = "at"
+payload = '''
+if config.name ~= 'bottom' then... | round_eval_rows shouldn't be a global, it could lead to weirdness when saving/loading |
smods | github_2023 | others | 202 | Steamodded | english5040 | @@ -395,6 +395,21 @@ function modsCollectionTally(pool, set)
return obj_tally
end
+function math.round(num, precision)
+ precision = 10^(precision or 0)
+
+ return math.floor(num * precision + 0.49999999999999994) / precision
+end
+
+-- Formatting util for UI elements (look number_formatting.toml)
+function forma... | move these functions to utils. though , file structure remains messy, sorry |
smods | github_2023 | others | 204 | Steamodded | english5040 | @@ -1,83 +1,6 @@
--- STEAMODDED CORE
--- MODULE MODLOADER
--- Attempt to require nativefs
-local nfs_success, nativefs = pcall(require, "nativefs")
-local lovely_success, lovely = pcall(require, "lovely")
-
-local lovely_mod_dir
-local library_load_fail = false
-if lovely_success then
- lovely_mod_dir = lovely.m... | Concerned about removing the block above. |
smods | github_2023 | others | 151 | Steamodded | english5040 | @@ -2419,165 +2423,237 @@ function loadAPIs()
})
-------------------------------------------------------------------------------------------------
- ----- API CODE GameObject.Palette
+ ----- API CODE GameObject.AltTexture
---------------------------------------------------------------------------... | The organization here is a bit weird, Types is not a 'real' element of the table |
smods | github_2023 | others | 151 | Steamodded | english5040 | @@ -2419,165 +2423,237 @@ function loadAPIs()
})
-------------------------------------------------------------------------------------------------
- ----- API CODE GameObject.Palette
+ ----- API CODE GameObject.AltTexture
---------------------------------------------------------------------------... | Just use {} here, if the SMODS.alt_textures name is not intended to be used |
smods | github_2023 | others | 151 | Steamodded | english5040 | @@ -2419,165 +2423,237 @@ function loadAPIs()
})
-------------------------------------------------------------------------------------------------
- ----- API CODE GameObject.Palette
+ ----- API CODE GameObject.AltTexture
---------------------------------------------------------------------------... | from_palette, from_atlas seem more natural. after all, we aren't creating a palette, we're creating a texture from a palette |
smods | github_2023 | others | 151 | Steamodded | english5040 | @@ -1017,87 +1016,87 @@ end
--#endregion
--#region enhancements UI
function create_UIBox_your_collection_enhancements(exit)
- local deck_tables = {}
- local rows, cols = 2, 4
- local page = 0
-
- G.your_collection = {}
- for j = 1, rows do
- G.your_collection[j] = CardArea(G.ROOM.T.x + 0.2 * G.ROOM.T.w / 2, G.ROOM.... | Sort Enhancements when they're initially defined, not here |
smods | github_2023 | others | 151 | Steamodded | english5040 | @@ -388,73 +388,93 @@ function serialize_string(s)
return string.format("%q", s)
end
---#region palettes
-G.SETTINGS.selected_colours = G.SETTINGS.selected_colours or {}
+--#region alt textures
+G.SETTINGS.selected_texture = G.SETTINGS.selected_texture or {}
G.PALETTE = {}
+G.C.AltTexture = HEX("277a97")
+default... | slight error in comment: palette -> 'texture' |
smods | github_2023 | others | 151 | Steamodded | english5040 | @@ -388,73 +388,93 @@ function serialize_string(s)
return string.format("%q", s)
end
---#region palettes
-G.SETTINGS.selected_colours = G.SETTINGS.selected_colours or {}
+--#region alt textures
+G.SETTINGS.selected_texture = G.SETTINGS.selected_texture or {}
G.PALETTE = {} | is this needed? |
smods | github_2023 | others | 151 | Steamodded | english5040 | @@ -388,73 +388,93 @@ function serialize_string(s)
return string.format("%q", s)
end
---#region palettes
-G.SETTINGS.selected_colours = G.SETTINGS.selected_colours or {}
+--#region alt textures
+G.SETTINGS.selected_texture = G.SETTINGS.selected_texture or {}
G.PALETTE = {}
+G.C.AltTexture = HEX("277a97")
+default... | Not sure what this is doing now |
smods | github_2023 | others | 151 | Steamodded | english5040 | @@ -805,22 +809,16 @@ function loadAPIs()
SMODS.process_loc_text(G.localization.descriptions.Other, 'undiscovered_' .. string.lower(self.key),
self.loc_txt, 'undiscovered')
end,
- generate_colours = function(self, base_colour, alternate_colour)
- if not self.colo... | Concerned about adding this- I don't want to add things to SMODS that are not generally useful utilities, this seems pretty specific. |
smods | github_2023 | others | 151 | Steamodded | english5040 | @@ -2302,10 +2310,6 @@ function loadAPIs()
SMODS.process_loc_text(G.localization.misc.labels, self.key:sub(3), self.loc_txt, 'label')
SMODS.Edition.super.process_loc_text(self)
end,
- -- apply_modifier = true when G.GAME.edition_rate is to be applied
- get_weight = funct... | Why was get_weight removed? also get_weight remains a bad name, sorry. to be honest, letting weight itself be either a number or a function might be better |
smods | github_2023 | others | 151 | Steamodded | english5040 | @@ -2419,165 +2423,237 @@ function loadAPIs()
})
-------------------------------------------------------------------------------------------------
- ----- API CODE GameObject.Palette
+ ----- API CODE GameObject.AltTexture
---------------------------------------------------------------------------... | Again, create_colours is something I am wary of including in Steamodded itself. I'd like these functions to be cohesive, any specific functions can go in a separate mod. |
smods | github_2023 | others | 151 | Steamodded | Aurelius7309 | @@ -2419,165 +2423,237 @@ function loadAPIs()
})
-------------------------------------------------------------------------------------------------
- ----- API CODE GameObject.Palette
+ ----- API CODE GameObject.AltTexture
---------------------------------------------------------------------------... | These `take_ownership` calls flood logs at startup for no good reason. Perhaps adding a way to make them not log anything would be reasonable |
smods | github_2023 | others | 151 | Steamodded | english5040 | @@ -102,16 +102,12 @@ function loadAPIs()
-- Setup Localize text
o:process_loc_text()
-
- sendInfoMessage(
- ('Registered game object %s of type %s')
- :format(o.key, o.set), o.set or 'GameObject'
- )
+ if not o.no_log then sendI... | for the no-logging functionality, I was thinking of a setting on the logging system, not a setting per-object. basically, some toggle that temporarily prevents logging. It could be as simple as a global variable- that's not extensible, but it's also simple enough to be fine |
smods | github_2023 | others | 138 | Steamodded | Aurelius7309 | @@ -22,14 +22,11 @@ function loadAPIs()
function SMODS.GameObject:__call(o)
o = o or {}
o.mod = SMODS.current_mod
- if o.mod and not o.raw_atlas_key and not (o.mod.omit_mod_prefix or o.omit_mod_prefix) then
+ if o.mod and not o.raw_atlas_key and not (o.mod.omit_mod_prefix or o.omit_... | Why should a `shader` being present prevent atlas keys from being prefixed? |
smods | github_2023 | python | 10 | Steamodded | Steamopollys | @@ -85,127 +92,145 @@ def modify_game_lua(game_lua_path):
print("Successfully modified game.lua.")
else:
print("Target line not found in game.lua.")
+ raise RuntimeError()
except IOError as e:
print(f"Error modifying game.lua: {e}")
+ raise RuntimeErr... | `base_dir = os.path.dirname(os.path.abspath(__file__))`
To match new file structure |
smods | github_2023 | python | 10 | Steamodded | Steamopollys | @@ -85,127 +92,145 @@ def modify_game_lua(game_lua_path):
print("Successfully modified game.lua.")
else:
print("Target line not found in game.lua.")
+ raise RuntimeError()
except IOError as e:
print(f"Error modifying game.lua: {e}")
+ raise RuntimeErr... | `# Running in a PyInstaller bundle` |
smods | github_2023 | python | 10 | Steamodded | Steamopollys | @@ -85,127 +92,145 @@ def modify_game_lua(game_lua_path):
print("Successfully modified game.lua.")
else:
print("Target line not found in game.lua.")
+ raise RuntimeError()
except IOError as e:
print(f"Error modifying game.lua: {e}")
+ raise RuntimeErr... | `# Running in a normal Python environment or Nuitka bundle` |
smods | github_2023 | others | 43 | Steamodded | jubnl | @@ -73,6 +72,9 @@ function SMODS.injectJokers()
effect = joker.effect,
cost = joker.cost,
cost_mult = 1.0,
+ blueprint_compat = joker.blueprint_compat,
+ eternal_compat = joker.eternal_compat,
+ effect = joker.effect
| The line 77 does not seems necessary seems the joker effect is already extracted at line 72.
The line 77 also crash the game becase there's a missing comma at the end of the line |
smods | github_2023 | python | 1 | Steamodded | Steamopollys | @@ -76,13 +76,13 @@ def modify_main_lua(main_lua_path, base_dir, directories):
# print("LuaJIT Decompiler downloaded.")
# URL to download the 7-Zip suite
- seven_zip_url = "https://cdn.discordapp.com/attachments/485484159603572757/1181530870029504514/7-Zip.zip?ex=6581655f&is=656ef05f&hm=3dfd3e5a4936b0a50... | 7z2301-x64.exe |
smods | github_2023 | python | 1 | Steamodded | Steamopollys | @@ -76,13 +76,13 @@ def modify_main_lua(main_lua_path, base_dir, directories):
# print("LuaJIT Decompiler downloaded.")
# URL to download the 7-Zip suite
- seven_zip_url = "https://cdn.discordapp.com/attachments/485484159603572757/1181530870029504514/7-Zip.zip?ex=6581655f&is=656ef05f&hm=3dfd3e5a4936b0a50... | 7z2301-x64.exe |
smods | github_2023 | others | 589 | Steamodded | GauntletGames-2086 | @@ -866,6 +866,11 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
prefix_config = { key = false },
inject = function(self)
G.P_CENTER_POOLS[self.key] = G.P_CENTER_POOLS[self.key] or {}
+ if self.cards then
+ for key, _ in pairs... | The game will crash if any of the keys within `cards` are not vanilla (since they're not injected until after `SMODS.ObjectType` is. |
git-backdate | github_2023 | others | 10 | rixx | rixx | @@ -122,7 +133,7 @@ def rewrite_history(
],
env=dict(os.environ, GIT_COMMITTER_DATE=timestamp.isoformat()),
)
- last_timestamp = timestamp
+ prev_timestamp = timestamp | So this is where I'm really baffled – not only is `last_timestamp` at least as correct as `prev_timestamp`, it's also two full words rather than an abbreviation. Matter of taste, I suppose, but I don't see how it's relevant to this PR. |
git-backdate | github_2023 | others | 10 | rixx | rixx | @@ -82,32 +91,34 @@ def rewrite_history(
elif no_business_hours:
min_hour = 18
max_hour = 23
- duration = len(days)
- commits_per_day = math.ceil(len(commits) / duration)
- last_timestamp = None
- commit_count = len(commits)
- day_progress = 0
- for commit_index in range(commit_... | Really sorry to be grumpy, but this place illustrates beautifully how short and readable this PR could have been without the renaming of variables. |
git-backdate | github_2023 | others | 10 | rixx | rixx | @@ -82,32 +91,34 @@ def rewrite_history(
elif no_business_hours:
min_hour = 18
max_hour = 23
- duration = len(days) | As `len(days)` doesn't change, isn't it preferable to compute it once outside the loop rather than again and again inside the loop? |
git-backdate | github_2023 | others | 10 | rixx | rixx | @@ -82,32 +91,34 @@ def rewrite_history(
elif no_business_hours:
min_hour = 18
max_hour = 23
- duration = len(days)
- commits_per_day = math.ceil(len(commits) / duration)
- last_timestamp = None
- commit_count = len(commits)
- day_progress = 0
- for commit_index in range(commit_... | This expression can throw an error, as `prev_timestamp.hour` is not guaranteed to be set here. |
git-backdate | github_2023 | others | 10 | rixx | rixx | @@ -82,32 +91,34 @@ def rewrite_history(
elif no_business_hours:
min_hour = 18
max_hour = 23
- duration = len(days)
- commits_per_day = math.ceil(len(commits) / duration)
- last_timestamp = None
- commit_count = len(commits)
- day_progress = 0
- for commit_index in range(commit_... | If the previous timestamp is significantly off our start, this will screw over all preceding calculations re: commits per day. |
diagram | github_2023 | others | 38 | pandoc-ext | tarleb | @@ -80,6 +80,7 @@ that can be used to specify a specific executable.
| [Mermaid] | `mermaid` | `mmdc` | `MERMAID_BIN` |
| [PlantUML] | `plantuml` | `plantuml` | `PLANTUML_BIN` |
| [Ti*k*Z] | `tikz` | `pdflatex` | `PDFLATEX_BIN` |
+| [cetz] | `cetz` | `typst` ... | The package itself seems to use the capitalization `CeTZ`. |
mrjs | github_2023 | javascript | 599 | Volumetrics-io | michaelthatsit | @@ -101,24 +103,95 @@ export class AnimationSystem extends MRSystem {
/**
* @function
- * @description Sets the Animation of the entity object based on the component value associated with it.
+ * @description Sets the Animation of the entity object based on the component value associated with it. O... | You can also do `comp?.action` which is a little cleaner. |
mrjs | github_2023 | javascript | 599 | Volumetrics-io | michaelthatsit | @@ -101,24 +103,95 @@ export class AnimationSystem extends MRSystem {
/**
* @function
- * @description Sets the Animation of the entity object based on the component value associated with it.
+ * @description Sets the Animation of the entity object based on the component value associated with it. O... | Maybe 'repeat' instead of 'loopMode'? |
mrjs | github_2023 | javascript | 578 | Volumetrics-io | michaelthatsit | @@ -12,56 +12,65 @@ import { MRTextInputEntity } from 'mrjs/core/entities/MRTextInputEntity';
export class MRTextAreaEntity extends MRTextInputEntity {
/**
* @class
+ * @description Constructor for the MRTextInputEntity entity component.
*/
constructor() {
super();
- // Define... | I think we talked about this but why aren't we putting this in the shadow root? might scale a little better. especially for embedded experiences. |
mrjs | github_2023 | javascript | 578 | Volumetrics-io | michaelthatsit | @@ -16,55 +14,91 @@ export class MRTextFieldEntity extends MRTextInputEntity {
*/
constructor() {
super();
- this.wrapper = this.shadowRoot.appendChild(document.createElement('div'));
- this.wrapper.innerHTML = '<slot></slot>';
+ this.lineHeight = 1.2; // Default line height, ca... | Related to my other comment. why a hidden field in the DOM instead of an actual field in the shadow? |
mrjs | github_2023 | javascript | 578 | Volumetrics-io | michaelthatsit | @@ -73,7 +107,7 @@ export class MRTextFieldEntity extends MRTextInputEntity {
// Ensure the cursor position is updated to reflect the current caret position
setTimeout(() => { | what's this for? |
mrjs | github_2023 | javascript | 581 | Volumetrics-io | hanbollar | @@ -116,7 +120,13 @@ export class PhysicsSystem extends MRSystem {
if (entity instanceof MRDivEntity) {
this.initPhysicsBody(entity);
this.registry.add(entity);
- entity.addEventListener('modelchange', this.entityEventUpdate);
+ entity.addEventListener('modelchan... | if child-updated is one of our own events, it would be better as `childupdated` since we're switching away from the hyphenated ones |
mrjs | github_2023 | javascript | 581 | Volumetrics-io | hanbollar | @@ -75,7 +75,7 @@ export class MRImageEntity extends MRMediaEntity {
// passed through MRMediaEntity directly is undefined since it is not
// a direct element for users. So we do the if-check here and then
// follow the same as the parent's functionality.
- if (mutation.type != 'attrib... | not sure i understand the reasoning for this swap - was this originally a typo? |
mrjs | github_2023 | javascript | 581 | Volumetrics-io | hanbollar | @@ -137,7 +137,7 @@ export class MRMediaEntity extends MRDivEntity {
mutated(mutation) {
super.mutated();
- if (mutation.type != 'attributes' && mutation.attributeName == 'src') {
+ if (mutation.type == 'attributes' && mutation.attributeName == 'src') { | same question for here |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.