Package: chemistry-and-robots
DescriptionThechemistry_and_robotspackage provides a collection of dataclasses and SPARQL query/update functions that are used by a series of agents capable of conducting automated reaction experiments as part ofTheWorldAvatarproject.chemistry_and_robotsusespyderivationagent>=1.1.0to accessPySparqlClientprovided inpyderivationagent.kg_operationsto form its SPARQL query/update utilities. For technical details, below are a few useful links:pyderivationagent- python wrapper for derivation agentpy4jps- python wrapper for jps-base-libInstallationFor development and testing reasons, follow below instructions to get a copy of the project up and running on your local system.Virtual environment setupIt is highly recommended to installchemistry_and_robotspackages in avirtual environment. The following steps can be taken to build a virtual environment:(Windows)$ python -m venv <venv_name>
$ <venv_name>\Scripts\activate.bat
(<venv_name>) $(Linux)$python3-mvenv<venv_name>
$source<venv_name>/bin/activate(<venv_name>)$The above commands will create and activate the virtual environment<venv_name>in the current directory.Installation via pipThe following command can be used to install thechemistry_and_robotspackage.(<venv_name>)$pipinstallchemistry_and_robotsHow to use itOntology data modelThis package provides ontological data models from five main ontologies, namely:OntoReaction: ontology for chemical reactionOntoDoE: ontology for design of experimentOntoLab: ontology for laboratoryOntoVapourtec: ontology for vapourtec flow chemistry hardwareOntoHPLC: ontology for HPLC analysis equipmentAll of the concepts are directly or indirectly inherited from theBaseOntologyclass which itself is inherited frompydantic.BaseModel. The design of these data model classes serve as a persistence layer between the agent operations in chemistry_and_robots and the data stored in the knowledge graph. Additionally, all TBox IRIs involved in the chemistry_and_robots as part of The World Avatar project are provided in thechemistry_and_robots.data_model.iris.py. Developer can import this module to make use of the concepts and relationships.SPARQL clientA SPARQL client classchemistry_and_robots.kg_operations.sparql_client.ChemistryAndRobotsSparqlClientis provided as part of this package. It provides a few SPARQL query and update functions that are helpful in handling data instantiated using the above ontology data models. These functions have been used to develope a few python agents, for more details, please refer to:DoEAgent,VapourtecExecutionAgent,HPLCPostProAgent,VapourtecAgent, andHPLCAgent.TestUnit and integration tests are written for this package. The tests should pass if you already correctly setup theDocker Environmentand obtained access toDocker Image Registry. To run tests, please execute below commands (remember to replace the<your_absolute_path_to>with actual path):(Linux)cd/<your_absolute_path_to>/TheWorldAvatar/Agents/utils/chemistry_and_robots
pytest-s--reruns5--reruns-delay5New features and package releaseDevelopers who add new features to thechemistry_and_robotspackage handle the distribution of the package on PyPI and Test-PyPI. If you want to add new features that suit your project and release the package independently, i.e. become a developer/maintainer, please contact the repository's administrator to indicate your interest.The release procedure is currently semi-automated and requires a few items:Your Test-PyPI and PyPI account and passwordThe version number x.x.x for the releaseClone ofTheWorldAvatarrepository on your local machineDocker-desktop is installed and running on your local machineYou have access to the docker.cmclinnovations.com registry on your local machine, for more information regarding the registry, see:https://github.com/cambridge-cares/TheWorldAvatar/wiki/Docker%3A-Image-registryStable version releaseFor a stable version release, please create and checkout to a new branch from your feature branch once you are happy with the feature and above details are ready. The release process can then be started by using the commands below, depending on the operating system you're using. (REMEMBER TO CHANGE THE CORRECT VALUES FOR<absolute_path_to>IN THE COMMANDS BELOW!)WARNING: at the moment, releasing package from Windows OS has an issue that the package will not be installed correctly while executing "$PIPPATH --disable-pip-version-check install -e $SPATH"[dev]"" in install_script_pip.sh. Please use Linux to release future versions before the issue is fixed.(Windows)$ cd \<absolute_path_to>\TheWorldAvatar\Agents\utils\chemistry_and_robots
$ release_chemistry_and_robots_to_pypi.sh -v x.x.x(Linux)$cd/<absolute_path_to>/TheWorldAvatar/Agents/utils/chemistry_and_robots
$./release_chemistry_and_robots_to_pypi.sh-vx.x.xPlease follow the instructions presented in the console once the process has begun. If everything goes well, change the version number inAgents/utils/chemistry_and_robots/release_chemistry_and_robots_to_pypi.shto the one you used for the script release.echo"./release_chemistry_and_robots_to_pypi.sh -v 0.0.1   - release version 0.0.1"The changes mentioned above should then be committed with the changes performed automatically during the release process, specifically in python scriptAgents/utils/chemistry_and_robots/chemistry_and_robots/__init__.py__version__ = "0.0.1"andAgents/utils/chemistry_and_robots/setup.pyversion='0.0.1',Finally, merge the release branch back to the feature branch and make a Pull Request for the feature branch to be merged back into themainbranch.Development version releaseFor development version release, you may do it in your feature branch. The development package will be released to TestPyPI repository by default. Once you have collected the required information, the release process can then be started by using the commands below. (REMEMBER TO CHANGE THE CORRECT VALUES FOR<absolute_path_to>IN THE COMMANDS BELOW!)NOTE: The development release requires the version number to contain a, b or rc (alpha, beta or release candidate) to be compatible with the pre-release configuration on TestPyPI. You may provide number at the end to differentiate different development version in the same pre-release stage, e.g., "1.1.0a1". In case no number is provided in the end (i.e., "1.0.0a"), "0" will be appended automatically to make it "1.0.0a0". For example, seeprerelease-example.(Linux)$cd/<absolute_path_to>/TheWorldAvatar/Agents/utils/chemistry_and_robots
$./release_chemistry_and_robots_to_pypi.sh-dx.x.xaPlease follow the instructions presented in the console once the process has begun. If everything goes well, change the version number and commit changes following the same procedure as in the stable version release, but no pull request is required.AuthorsJiaru Bai (jb2197@cam.ac.uk)