Skip to content

Minor improvements#38

Merged
EsIstJosh merged 1 commit into
mainfrom
dev
May 8, 2025
Merged

Minor improvements#38
EsIstJosh merged 1 commit into
mainfrom
dev

Conversation

@EsIstJosh
Copy link
Copy Markdown
Owner

@EsIstJosh EsIstJosh commented May 8, 2025

Comment thread build.sh
WARNING="${YELLOW}[WARNING]${NC} "

rm -rf dist/bundle.js dist/typings/
# Initialize flags

Check notice

Code scanning / Shellcheck (reported by Codacy)

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. Note

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Comment thread build.sh
echo -e "${WARNING}could not delete old dist files, continuing.."
# Parse command-line options
while getopts ":bpu" opt; do
case ${opt} in

Check notice

Code scanning / Shellcheck (reported by Codacy)

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. Note

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Comment thread build.sh
BUILD=true
;;
p )
PACKAGE=true

Check notice

Code scanning / Shellcheck (reported by Codacy)

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. Note

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Comment thread build.sh

# Run Rollup to build the project
npx rollup -c rollup.config.js
if [[ $? -ne 0 ]]; then

Check notice

Code scanning / Shellcheck (reported by Codacy)

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. Note

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Comment thread build.sh

# Build source distribution and wheel
sudo "$VENV_PYTHON" -m build --sdist
if [[ $? -ne 0 ]]; then

Check notice

Code scanning / Shellcheck (reported by Codacy)

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. Note

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Comment thread build.sh
fi

sudo "$VENV_PYTHON" -m build --wheel
if [[ $? -ne 0 ]]; then

Check notice

Code scanning / Shellcheck (reported by Codacy)

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. Note

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Comment thread build.sh
if [ -d "$OUTPUT_DIR" ]; then
echo -e "${INFO}Removing existing output directory..."
sudo rm -rf "$OUTPUT_DIR"
if [[ $? -ne 0 ]]; then

Check notice

Code scanning / Shellcheck (reported by Codacy)

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. Note

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Comment thread build.sh

# Create output directory
mkdir -p "$OUTPUT_DIR"
if [[ $? -ne 0 ]]; then

Check notice

Code scanning / Shellcheck (reported by Codacy)

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. Note

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Comment thread build.sh

# Move distribution files to output directory
mv "${files[@]}" "$OUTPUT_DIR"/
if [[ $? -ne 0 ]]; then

Check notice

Code scanning / Shellcheck (reported by Codacy)

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. Note

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
Comment thread build.sh

# Upload distributions using twine
"$VENV_PYTHON" -m twine upload "$OUTPUT_DIR"/*
if [[ $? -ne 0 ]]; then

Check notice

Code scanning / Shellcheck (reported by Codacy)

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. Note

Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.

if self._last_bar is None or time > self._last_bar['time']:
# Start new candle from tick
bar = pd.Series({

Check warning

Code scanning / Prospector (reported by Codacy)

Black listed name "bar" (blacklisted-name) Warning

Black listed name "bar" (blacklisted-name)
})
else:
# Update current candle with new tick
bar = self._last_bar.copy()

Check warning

Code scanning / Prospector (reported by Codacy)

Black listed name "bar" (blacklisted-name) Warning

Black listed name "bar" (blacklisted-name)
bar['volume'] = series['volume']

self._last_bar = bar
self.update(bar, _from_tick=True)

Check warning

Code scanning / Prospector (reported by Codacy)

Unexpected keyword argument '_from_tick' in method call (unexpected-keyword-arg) Warning

Unexpected keyword argument '_from_tick' in method call (unexpected-keyword-arg)
self.show(block=False)
try:
from lightweight_charts import polygon
from lightweight_charts_esistjosh import polygon

Check warning

Code scanning / Prospector (reported by Codacy)

Import outside toplevel (lightweight_charts_esistjosh.polygon) (import-outside-toplevel) Warning

Import outside toplevel (lightweight_charts_esistjosh.polygon) (import-outside-toplevel)
class Pane:
def __init__(self, window):
from lightweight_charts import Window
from lightweight_charts_esistjosh import Window

Check warning

Code scanning / Prospector (reported by Codacy)

Import outside toplevel (lightweight_charts_esistjosh.Window) (import-outside-toplevel) Warning

Import outside toplevel (lightweight_charts_esistjosh.Window) (import-outside-toplevel)
Comment thread run.py
#
#
# if not pd.isna(tick['HL']):
# symbols_series.update(pd.Series(

Check warning

Code scanning / Prospector (reported by Codacy)

indentation is not a multiple of four (comment) (E114) Warning

indentation is not a multiple of four (comment) (E114)
Comment thread run.py
#
# if not pd.isna(tick['HL']):
# symbols_series.update(pd.Series(
# {'time': tick['time'], 'value': tick['HL']},

Check warning

Code scanning / Prospector (reported by Codacy)

indentation is not a multiple of four (comment) (E114) Warning

indentation is not a multiple of four (comment) (E114)
Comment thread run.py
# if not pd.isna(tick['HL']):
# symbols_series.update(pd.Series(
# {'time': tick['time'], 'value': tick['HL']},
# name=tick['time']

Check warning

Code scanning / Prospector (reported by Codacy)

indentation is not a multiple of four (comment) (E114) Warning

indentation is not a multiple of four (comment) (E114)
Comment thread run.py
# symbols_series.update(pd.Series(
# {'time': tick['time'], 'value': tick['HL']},
# name=tick['time']
# ))

Check warning

Code scanning / Prospector (reported by Codacy)

indentation is not a multiple of four (comment) (E114) Warning

indentation is not a multiple of four (comment) (E114)
Comment thread run.py
# name=tick['time']
# ))
#
# sleep(0.2)

Check warning

Code scanning / Prospector (reported by Codacy)

indentation is not a multiple of four (comment) (E114) Warning

indentation is not a multiple of four (comment) (E114)
self._last_bar = series
self.run_script(f'{self.id}.series.update({js_data(series)})')

def update_from_tick(self, series: pd.Series, cumulative_volume: bool = False):

Check warning

Code scanning / Pylint (reported by Codacy)

Missing method docstring Warning

Missing method docstring

if self._last_bar is None or time > self._last_bar['time']:
# Start new candle from tick
bar = pd.Series({

Check warning

Code scanning / Pylint (reported by Codacy)

Black listed name "bar" Warning

Black listed name "bar"
})
else:
# Update current candle with new tick
bar = self._last_bar.copy()

Check warning

Code scanning / Pylint (reported by Codacy)

Black listed name "bar" Warning

Black listed name "bar"
self.show(block=False)
try:
from lightweight_charts import polygon
from lightweight_charts_esistjosh import polygon

Check warning

Code scanning / Pylint (reported by Codacy)

No name 'polygon' in module 'lightweight_charts_esistjosh' Warning

No name 'polygon' in module 'lightweight_charts_esistjosh'


class WxChart(abstract.AbstractChart):
class WxChart(AbstractChart):

Check warning

Code scanning / Pylint (reported by Codacy)

Missing class docstring Warning

Missing class docstring
with open(INDEX.replace("index.html", 'bundle.js'), 'r') as f:
js = f.read()
with open(abstract.INDEX.replace("index.html", 'lightweight-charts.js'), 'r') as f:
with open(INDEX.replace("index.html", 'lightweight-charts.js'), 'r') as f:

Check warning

Code scanning / Pylint (reported by Codacy)

Variable name "f" doesn't conform to snake_case naming style Warning

Variable name "f" doesn't conform to snake_case naming style
lwc = f.read()

with open(abstract.INDEX, 'r') as f:
with open(INDEX, 'r') as f:

Check warning

Code scanning / Pylint (reported by Codacy)

Variable name "f" doesn't conform to snake_case naming style Warning

Variable name "f" doesn't conform to snake_case naming style
Comment thread run.py

midpoint = data.shape[0] // 2
#data['price'] = (data['close'] + data['open']) / 2
midpoint = 50

Check warning

Code scanning / Pylint (reported by Codacy)

Constant name "midpoint" doesn't conform to UPPER_CASE naming style Warning

Constant name "midpoint" doesn't conform to UPPER_CASE naming style
Comment thread run.py
midpoint = 50
df1 = data.iloc[:midpoint]
df2 = data.iloc[midpoint+1:]
df2 = data.iloc[midpoint+1:midpoint+50]

Check warning

Code scanning / Pylint (reported by Codacy)

Constant name "df2" doesn't conform to UPPER_CASE naming style Warning

Constant name "df2" doesn't conform to UPPER_CASE naming style
Comment thread run.py
chart = Chart(toolbox=True, debug=True, defaults= "./lightweight_charts_esistjosh/defaults", scripts= "./lightweight_charts_esistjosh/scripts")

chart.events.search += on_search
chart.topbar

Check notice

Code scanning / Pylint (reported by Codacy)

Statement seems to have no effect Note

Statement seems to have no effect
Comment thread lightweight_charts_esistjosh/abstract.py Dismissed
Comment thread lightweight_charts_esistjosh/abstract.py Dismissed
Comment thread lightweight_charts_esistjosh/abstract.py Dismissed
Comment thread lightweight_charts_esistjosh/abstract.py Dismissed
Comment thread lightweight_charts_esistjosh/chart.py Dismissed
Comment thread lightweight_charts_esistjosh/widgets.py Dismissed
with open(INDEX.replace("index.html", 'bundle.js'), 'r') as f:
js = f.read()
with open(abstract.INDEX.replace("index.html", 'lightweight-charts.js'), 'r') as f:
with open(INDEX.replace("index.html", 'lightweight-charts.js'), 'r') as f:

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Variable name "f" doesn't conform to snake_case naming style Warning

Variable name "f" doesn't conform to snake_case naming style
Comment thread lightweight_charts_esistjosh/widgets.py Dismissed
Comment thread run.py

midpoint = data.shape[0] // 2
#data['price'] = (data['close'] + data['open']) / 2
midpoint = 50

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Constant name "midpoint" doesn't conform to UPPER_CASE naming style Warning

Constant name "midpoint" doesn't conform to UPPER_CASE naming style
Comment thread run.py
chart = Chart(toolbox=True, debug=True, defaults= "./lightweight_charts_esistjosh/defaults", scripts= "./lightweight_charts_esistjosh/scripts")

chart.events.search += on_search
chart.topbar

Check notice

Code scanning / Pylintpython3 (reported by Codacy)

Statement seems to have no effect Note

Statement seems to have no effect
@EsIstJosh EsIstJosh merged commit 1aa9972 into main May 8, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants