Skip to content

Commit

Permalink
v2.12 - Bumped Python to 3.11.6 for higher sqlite3 version to fix chr…
Browse files Browse the repository at this point in the history
…omadb error

- Python version bumped
- Cosmetic updates
- pyinstallered dep disabled
  • Loading branch information
pranjal-joshi committed Nov 16, 2023
1 parent 5a34151 commit c3d5f8b
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/workflow-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10.6
uses: actions/setup-python@v2
- name: Set up Python 3.11.6
uses: actions/setup-python@v4
with:
python-version: 3.10.6
python-version: 3.11.6

- name: Restore Dependencies from Cache
uses: actions/cache@v2
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

# FROM ubuntu:latest as base
# FROM tensorflow/tensorflow:2.9.2 as base
FROM python:3.10.6-slim as base
# FROM python:3.10.6-slim as base
FROM python:3.11.6-slim-bookworm as base

ARG DEBIAN_FRONTEND=noninteractive

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pep517
pip
pip-chill
progress
pyinstaller==5.6.2
# pyinstaller==5.6.2
pytest-mock
pytoml
retrying
Expand Down
6 changes: 5 additions & 1 deletion src/classes/Changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from classes.ColorText import colorText

VERSION = "2.11"
VERSION = "2.12"

changelog = colorText.BOLD + '[ChangeLog]\n' + colorText.END + colorText.BLUE + '''
[1.00 - Beta]
Expand Down Expand Up @@ -256,5 +256,9 @@
[2.11]
1. Nifty Prediction issue fixed - Model is now trained on CPU instead of Apple-M1 GPU
[2.12]
1. Cosmetic Updates for Position Size Calculator
2. Python base bumped to 3.11.6-slim-bookworm
''' + colorText.END
9 changes: 9 additions & 0 deletions src/screenipy.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,15 @@ def main(testing=False, testBuild=False, downloadOnly=False, execute_inputs:list
sys.exit(0)
elif tickerOption == 'N':
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
physical_devices = tf.config.list_physical_devices('GPU')
try:
tf.config.set_visible_devices([], 'GPU')
visible_devices = tf.config.get_visible_devices()
for device in visible_devices:
assert device.device_type != 'GPU'
except:
pass
prediction = screener.getNiftyPrediction(
data=fetcher.fetchLatestNiftyDaily(proxyServer=proxyServer),
proxyServer=proxyServer
Expand Down
10 changes: 6 additions & 4 deletions src/streamlit_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from pathlib import Path
from threading import Thread
from time import sleep
from math import floor
import classes.ConfigManager as ConfigManager

st.set_page_config(layout="wide", page_title="Screeni-py", page_icon="📈")
Expand Down Expand Up @@ -517,11 +518,12 @@ def get_extra_inputs(tickerOption, executeOption, c_index=None, c_criteria=None,

if calculate_qty_btn:
if sl > 0:
qty = round(risk_rs / sl)
oc.info(body=f'**Order Qty should be {qty}**', icon='✅')
qty = floor(risk_rs / sl)
oc.metric(label='Quantity', value=qty, delta=f'Max Loss: {(-1 * qty * sl)}', delta_color='inverse', help='Trade this Quantity to prevent excessive unplanned losses')
elif price > 0 and percentage_sl > 0:
qty = round(risk_rs / actual_sl)
oc.info(body=f'**Order Qty should be {qty}**', icon='✅')
qty = floor(risk_rs / actual_sl)
oc.metric(label='Quantity', value=qty, delta=f'Max Loss: {(-1 * qty * actual_sl)}', delta_color='inverse', help='Trade this Quantity to prevent excessive unplanned losses')


marquee_html = '''
<!DOCTYPE html>
Expand Down

0 comments on commit c3d5f8b

Please sign in to comment.