Skip to content

Feature/problems in db#21

Merged
XanderVertegaal merged 19 commits into
developfrom
feature/problems-in-db
Jun 6, 2025
Merged

Feature/problems in db#21
XanderVertegaal merged 19 commits into
developfrom
feature/problems-in-db

Conversation

@XanderVertegaal
Copy link
Copy Markdown
Contributor

@XanderVertegaal XanderVertegaal commented May 22, 2025

Allows the import of SICK and FraCaS datasets and removes the 'example' app from the frontend and backend code.

@XanderVertegaal XanderVertegaal requested a review from Copilot May 22, 2025 08:38
@XanderVertegaal XanderVertegaal marked this pull request as ready for review May 22, 2025 08:38
@XanderVertegaal XanderVertegaal requested a review from bbonf May 22, 2025 08:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new "problem" feature by adding models, utility functions, views, and commands to import problem data, while also deprecating the example app.

  • Added Django models for SickProblem, FracasProblem, and FracasPremise
  • Created import commands for SICK and FraCaS problems with corresponding migrations
  • Updated URL routes and settings by removing the deprecated example app

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
backend/problem/views.py Added basic view module with a placeholder comment
backend/problem/utils.py Added a progress utility function for console progress display
backend/problem/models.py Created models for problem management with validations
backend/problem/migrations/0002_fracasproblem_fracaspremise.py Added migration for FracasProblem and FracasPremise models
backend/problem/migrations/0001_initial.py Initial migration for SickProblem model
backend/problem/management/commands/import_sick.py Implemented command to import SICK problems from a TSV file
backend/problem/management/commands/import_fracas.py Implemented command to import FraCaS problems from an XML file
backend/problem/apps.py Added Django app configuration for the "problem" app
backend/langpro_annotator/urls.py Updated URL configuration and removed the deprecated example view
backend/langpro_annotator/proxy_frontend.py Fixed a documentation typo in the proxy frontend function
backend/langpro_annotator/common_settings.py Updated installed apps in settings by replacing "example" with "problem"
backend/example/* Removed deprecated example app modules
backend/.gitignore Excluded problem/data files from version control
Comments suppressed due to low confidence (1)

backend/problem/models.py:62

  • Typo in help_text: 'origianl' should be corrected to 'original'.
help_text='Indicates whether the answer in the origianl FraCaS problem is non-standard (i.e. not "Yes", "No", or "Don't know")'

Comment thread backend/problem/models.py Outdated
Comment thread backend/problem/utils.py Outdated
Comment thread backend/problem/models.py
@XanderVertegaal XanderVertegaal requested a review from Copilot May 22, 2025 13:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces functionality to import SICK and FraCaS datasets into the system while removing the outdated 'example' app from both the frontend and backend.

  • Adds dataclasses for problem types with clear attributes.
  • Implements import commands for SICK (TSV) and FraCaS (XML) problems with JSON conversion and database persistence.
  • Removes obsolete example app code and updates settings to reference the new problem app.

Reviewed Changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
backend/problem/types.py Introduces immutable dataclasses for SICK and FraCaS problems.
backend/problem/services.py Provides services to convert Problem model data into corresponding dataclass instances, with error handling via print statements.
backend/problem/models.py Adds the Problem model with type choices and content field.
backend/problem/management/commands/import_sick.py Implements CSV-based import for SICK problems into the database.
backend/problem/management/commands/import_fracas.py Implements XML-based import for FraCaS problems with section annotation support.
backend/langpro_annotator/urls.py Removes references to the obsolete example app and tidies SPA proxy routes.
backend/langpro_annotator/proxy_frontend.py Corrects the docstring typo in the proxy view wrapper.
backend/langpro_annotator/common_settings.py Updates installed apps and logging configuration; removes example app references.
backend/example/* Removes obsolete example code.
backend/.gitignore Adds exclusion for problem data files.
Comments suppressed due to low confidence (1)

backend/problem/services.py:26

  • Using print statements for error handling can lead to inconsistent logging; consider using a logging mechanism (e.g., logger.warning) for better maintainability and consistency with the rest of the project.
print(f"Warning: Could not parse JSON content for Problem ID {problem_obj.id}")

Comment thread backend/problem/management/commands/import_sick.py
@XanderVertegaal XanderVertegaal requested a review from bbonf May 22, 2025 13:24
@XanderVertegaal
Copy link
Copy Markdown
Contributor Author

Round two! How about this architecture?

Comment thread backend/problem/services.py
Comment thread backend/problem/services.py Outdated
Comment thread backend/requirements.txt
Comment thread backend/problem/management/commands/import_fracas.py Outdated
@XanderVertegaal XanderVertegaal merged commit 60de491 into develop Jun 6, 2025
1 check 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.

3 participants