Skip to content

The InChI-Web-Demo repository contains the code for the evaluation of InChIs out of chemical depictions in any browser for training and test purposes.

License

Notifications You must be signed in to change notification settings

IUPAC-InChI/InChI-Web-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InChI-Web-Demo

Local development

We recommend setting up our development container as a pre-configured local development environment. For details on how to get started with the container see https://containers.dev and https://code.visualstudio.com/docs/devcontainers/containers. When you're not using the development container, make sure that your environment supports the Emscripten toolchain (https://github.com/emscripten-core/emsdk).

Build

The web-demo is served from the pages directory. Set up all required resources under pages by running

./pages/build_wasm_modules.sh $(pwd)
./pages/download_packages.sh $(pwd)
source ./pages/utils.sh
build_ketcher $(pwd)

from the root of the repository (the argument to the scripts must be the absolute path to the root of the project).

Once pages contains all resources, serve the web-demo locally on localhost:8000 with

cd pages && python3 -m http.server

Test

You find a test suite for the WASM modules under test.

Note that we're not aiming to comprehensively exercise the functionality of the modules under test. We leave that up to the underlying packages themselves (e.g., we rely on InChI's downstream test coverage). Rather, this directory contains smoke tests that aim to ensure successful compilation of the WASM modules.

The following commands are assumed to be run from within the test directory. Install the test dependencies by running

yarn install

You can then run the entire suite with

yarn test

or a subset with

yarn run jest <path_to_test_file>

Deployment

You can deploy the web-demo via GitHub actions. Navigate to the "Deploy GitHub Pages" workflow in the "Actions" tab of the GitHub repository. The workflow has a manual trigger, i.e., you can deploy the web-demo with the push of a button. For details regarding the deployment, have a look at the workflow configuration.

Update an InChI version

The web-demo allows for the selection of different InChI versions. Those versions are configured in inchi_versions.json. Each version is pinned to a specific commit. You can change the commit that's associated with a version by editing the version's commit entry. Once you've changed the commit, you can re-compile the web-assembly module of the version:

source ./pages/utils.sh
build_inchi_wasm <version> pages/inchi_versions.json $(pwd)

where <version> can be any of the top-level keys in inchi_versions.json. It's a good idea to subsequently test the update locally. Once you're satisfied with the test results, you can deploy the update.

About

The InChI-Web-Demo repository contains the code for the evaluation of InChIs out of chemical depictions in any browser for training and test purposes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5