Skip to content

Commit

Permalink
bug fixes and more
Browse files Browse the repository at this point in the history
  • Loading branch information
luisfbl committed Sep 12, 2024
1 parent 8711487 commit 1906387
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 30 deletions.
41 changes: 20 additions & 21 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
name: Python

on: [push, pull_request]
on: [ push, pull_request ]

permissions:
contents: read

jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with unittest
run: |
python -m unittest discover -s src/tests
- name: Generate Artifacts
run: pyinstaller --onefile src/cli/main.py
- name: Archive Artifacts
uses: actions/upload-artifact@v2
with:
name: predimate-artifacts
path: ./dist
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with unittest
run: |
python -m unittest discover -s src/tests
- name: Generate Artifacts
run: pyinstaller --onefile src/cli/main.py -p .
- name: Archive Artifacts
uses: actions/upload-artifact@v2
with:
name: predimate-artifacts
path: ./dist
4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
pyinstaller
texttable
igraph
plotly
texttable
8 changes: 3 additions & 5 deletions src/cli/main.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
from texttable import Texttable

from src.data.encode import encode_expression
from src.cli.truth_table import generate_truth_table


def print_main_header():
header = """
header = r"""
_____ _ _ _
| __ \ | (_) | |
| |__) | __ ___ __| |_ _ __ ___ __ _| |_ ___
| ___/ '__/ _ \/ _` | | '_ ` _ \ / _` | __/ _ \\
| ___/ '__/ _ \/ _` | | '_ ` _ \ / _` | __/ _ \
| | | | | __/ (_| | | | | | | | (_| | || __/
|_| |_| \___|\__,_|_|_| |_| |_|\__,_|\__\___|
"""
Expand All @@ -35,7 +33,7 @@ def parse_input(item, prepositions, expressions):
expressions.append(wrapped)

for prep in list(filter(lambda char: char.isalpha() and char != 'v', item)):
if prep not in prepositions:
if prep.upper() not in prepositions:
prepositions.append(prep.upper())


Expand Down
2 changes: 1 addition & 1 deletion src/data/encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def encode_expression(expr: str) -> Base:
i = j
else:
j = find_end(expr[i:]) + i + 1
sub_result = encode_expression(expr[i:])
sub_result = encode_expression(expr[i:j])
i = j

result.append(Negation(sub_result))
Expand Down

0 comments on commit 1906387

Please sign in to comment.