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

Feature: MP parser frontend scaffolding + API calls #84

Merged
merged 10 commits into from
Jan 9, 2025

Conversation

XanderVertegaal
Copy link
Contributor

@XanderVertegaal XanderVertegaal commented Nov 20, 2024

(#81 should be reviewed/merged first.) Done!

Some more scaffolding before the actual parser + visualizer are added to the Docker network. This code is mostly a copy/adaptation of what is already in place for Spindle/Aethel.

This PR adds a new Django app minimalist_parser to backend, with a status check akin to the one in place for the spindle and aethel_db apps. The idea is that the server can check the other containers in the network to make sure the services are all running, and to notify the frontend if they aren't.

Regarding the frontend, this PR expands the MinimalistParserInput component and adds a service to deal with the data fetching.

Next step is to add the containers to the Docker network and try to actually apply the parser to user input!

@XanderVertegaal XanderVertegaal added the minimalist parser Part of the Minimalist Parser demo project (NLP) label Nov 20, 2024
@@ -123,6 +124,8 @@

SPINDLE_URL = f"http://pp-spindle:32768/"
LATEX_SERVICE_URL = f"http://pp-latex:32769/"
MINIMALIST_PARSER_URL = f"http://pp-minimalist-parser:32770/"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not in use yet, so don't try to connect to them ;)

Copy link
Contributor

@Meesch Meesch left a comment

Choose a reason for hiding this comment

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

Okay, also looks good: not too many moving parts yet so not too much feedback.

}


def status_check(service: Literal["spindle", "minimalist_parser", "vulcan"]) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm yes very functional very nice


} @else {
<p class="notification mt-6" i18n>
The Minimalist Parser is temporarily unavailable.
Copy link
Contributor

Choose a reason for hiding this comment

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

Love the 'temporarily'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's important to give your users hope and prospects of a better future ;)

});
}

public parse(): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, considering the exportResult function from spindle.component.ts:

public parse(): void {
        this.form.controls.mpInput.markAsTouched();
        this.form.controls.mpInput.updateValueAndValidity();
        const input = this.form.controls.mpInput.value;
        if (this.form.invalid || !input) {
            return;
        }
        this.apiService.input$.next(input);
    }

These functions are very similar: could we think of a good way to make them generalizable / put them in a service? Is that even worthwhile, do you think? I'm happy to let this rest since it's not really priority but I was wondering all the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I definitely there is room to DRY this code a bit more. I've created a new issue for it: #93 .

Base automatically changed from feature/basic-nav-structure to feature/minimalist-parser January 9, 2025 10:51
@XanderVertegaal XanderVertegaal merged commit 4892519 into feature/minimalist-parser Jan 9, 2025
1 check passed
@XanderVertegaal XanderVertegaal deleted the feature/parser-api-calls branch January 9, 2025 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minimalist parser Part of the Minimalist Parser demo project (NLP)
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants