Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Table Index offset #113

Merged
merged 2 commits into from
Jul 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,8 @@ jobs:
run: |
export path_to_file=$(find dist -type f -name "problem_bank_scripts-*.${{ matrix.dist.extension }}")
echo "::notice::Installing ${{ matrix.dist.name }}: $path_to_file"
python -m pip install --user $path_to_file
python -m pip install --user "$path_to_file[tests]"
python -m pip list
- name: Install test dependencies
run: python -m pip install --user pytest fastjsonschema
- name: Run tests against installed wheel
run: rm -rf src/ && pytest tests/

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
cache: poetry
- name: Install dependencies
run: |
poetry install --with dev
poetry install -E tests
- name: Run tests
run: |
poetry run pytest tests
Expand Down
21 changes: 11 additions & 10 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ ipykernel = {version = "^6.29.5", optional = true}
sphinx-rtd-theme = {version = "^2.0.0", optional = true}
myst-nb = {version = "^1.1.1", optional = true}
myst-parser = {version = "^3.0.1", optional = true}
pytest = {version = "^8.2.2", optional = true}
fastjsonschema = {version = "^2.20.0", optional = true}

[tool.poetry.extras]
tui = ["questionary", "nltk", "openai", "pdf2image", "scikit-learn", "python-dotenv"]
docs = ["Sphinx", "nbsphinx", "ipykernel", "sphinx-rtd-theme", "myst-nb", "myst-parser"]

[tool.poetry.group.dev.dependencies]
pytest = "^8.2.2"
tests = ["pytest", "fastjsonschema"]

[tool.poetry.scripts]
pbs-cli = "problem_bank_scripts.scripts.cli:main"
Expand All @@ -54,6 +54,5 @@ process = "problem_bank_scripts.scripts.process:main"
process_q = "problem_bank_scripts.scripts.process_q:main"
checkq = "problem_bank_scripts.scripts.check_question:main"


[tool.pytest.ini_options]
filterwarnings = ["error", "ignore::DeprecationWarning:problem_bank_helpers"]
2 changes: 1 addition & 1 deletion src/problem_bank_scripts/tui/write_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def write_code(exercise: dict):
for i, table in enumerate(exercise["tables"], start=1):
lines.append(f"table{i} = {table['matrix']}")
lines.append(
f'data2["params"]["table{i}"] = pbh.create_html_table(table{i+1}, width="550px", '
f'data2["params"]["table{i}"] = pbh.create_html_table(table{i}, width="550px", '
f'first_row_is_header={table.get("first_row_is_header", True)}, first_col_is_header={table.get("first_col_is_header", False)},)'
)

Expand Down
Loading