Conversation
| 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
| 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
| 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
|
|
||
| # 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
|
|
||
| # 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
| 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
| 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
|
|
||
| # 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
|
|
||
| # 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
|
|
||
| # 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
|
|
||
| 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
| }) | ||
| 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
| 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
| 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
| 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
| # | ||
| # | ||
| # 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
| # | ||
| # 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
| # 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
| # 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
| # name=tick['time'] | ||
| # )) | ||
| # | ||
| # sleep(0.2) |
Check warning
Code scanning / Prospector (reported by Codacy)
indentation is not a multiple of four (comment) (E114) Warning
| 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
|
|
||
| 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
| }) | ||
| 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
| 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
|
|
||
|
|
||
| class WxChart(abstract.AbstractChart): | ||
| class WxChart(AbstractChart): |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing class docstring Warning
| 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
| 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
|
|
||
| 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
| 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
| 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
| 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
|
|
||
| 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
| 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
Fix topbar,
add update_from_tick to the custom candle series