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

Skypilot upgrade to Main #56

Merged
merged 117 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
d4a186f
Basic persistent GUI server prototype in separate thread
themoenen Jan 30, 2024
7f0b082
Added install and launch gui commands
themoenen Jan 30, 2024
83ca173
gui api
themoenen Jan 31, 2024
3f25086
gui api updates
themoenen Feb 7, 2024
94b4d48
Added GUI api endpoints
Feb 22, 2024
36410e1
Remove openad-gui files from git
Feb 22, 2024
99adb5a
stash
Feb 25, 2024
8fccfa8
stash laptop
themoenen Feb 25, 2024
8d63b94
stash
themoenen Feb 25, 2024
13897f3
demo prototype
Feb 26, 2024
7a8d9bd
stash
Feb 28, 2024
72959aa
switch workspace GUI API
themoenen Feb 28, 2024
3f8b8cb
Added hydrogen atoms to 3d coordinates data
themoenen Feb 29, 2024
d0c06d9
Websocket experiment
Mar 5, 2024
75ee286
Merge branch 'gui_api_moe' of https://github.com/acceleratedscience/o…
Mar 5, 2024
89cbf17
created filesystem worker and refactored 'list files' command to use …
Mar 7, 2024
3eabb6e
Refactored fs_get_file and fs_get_workspace files to follow similar d…
Mar 12, 2024
395248c
stash
Mar 15, 2024
7927c00
Before removing index_only functionality from get_molset()
Mar 18, 2024
6ad684e
Indexing done right wip
Mar 19, 2024
44f10eb
Stash
Mar 19, 2024
8ec85a2
stash before refactoring molset fs/cache reading
Mar 21, 2024
5b29f84
sdf processing + api refactor
Mar 22, 2024
7544a58
added 'enriched' parameter to molecule object
Mar 22, 2024
cf6bcba
fixed list files
Mar 25, 2024
cd31eca
Removed old messy molecule API functions
Mar 26, 2024
5acfbab
implemented reverse sort
Mar 27, 2024
3b75f55
Support for invalid file paths and smiles in .smi files
Mar 27, 2024
f1388a9
stash
Apr 8, 2024
a36d66b
various
Apr 9, 2024
c0ab2c0
cleanup & debugging
Apr 10, 2024
c46b451
Mega commit regarding persistent GUI updates
Jul 11, 2024
39aae06
RXN login error message update
Jul 11, 2024
cdc5720
updated grammar in models to allow auth_group and service name withou…
Jul 11, 2024
adc837f
Merged conflicts
Jul 11, 2024
336c19d
Merged conflicts #2
Jul 11, 2024
264c960
fix for unspported PDF viewing
Jul 11, 2024
f7a78dc
changed host for flask apps to 0.0.0.0
Jul 11, 2024
a62815d
changed host for flask apps to 0.0.0.0 port 5005 starter
Jul 11, 2024
44525ed
cleaned up molecules
Jul 12, 2024
01d6848
adding auth group to catalog model service
Jul 15, 2024
b8b2f16
adding auth group to catalog model service
Jul 15, 2024
376976e
fix opena api session management
Jul 15, 2024
b75c87a
fix openad rxn api session management
Jul 15, 2024
f1fa965
fix openad rxn api session management
Jul 15, 2024
3b74d4e
fix openad rxn api session management
Jul 15, 2024
8dd5114
fix openad rxn api session management
Jul 15, 2024
e8c461d
fix openad rxn api session management
Jul 15, 2024
b5555a3
fix openad rxn api session management
Jul 15, 2024
45343c0
fix openad rxn api session management
Jul 15, 2024
5bc46cd
fix openad rxn api session management
Jul 15, 2024
3c190d9
fix openad rxn api session management
Jul 16, 2024
f32de23
fix openad rxn api session management
Jul 16, 2024
3a39343
fix openad rxn api session management
Jul 16, 2024
0e74056
fix openad rxn api session management
Jul 16, 2024
2a0290c
fine tune jupyter install
Jul 16, 2024
a614104
install update
Jul 16, 2024
e300f2c
install update
Jul 16, 2024
6215ebc
install update
Jul 16, 2024
6569a4b
fix openad rxn api session management
Jul 16, 2024
81cd272
fix openad rxn api session management
Jul 16, 2024
9ae44c3
Added command to show working set molecules
Jul 16, 2024
da938fa
stash
Jul 16, 2024
fe0ada4
Merged persistent GUI
Jul 16, 2024
cafdd45
Added openad-gui build folder
Jul 16, 2024
0b453dd
stash show_molset
Jul 16, 2024
3c470a7
Moved openad-gui folder inside openad folder so it is part of pip ins…
Jul 16, 2024
3408a51
Added gui-build folder
Jul 16, 2024
29d143b
Move to port 0.0.0.0
Jul 16, 2024
d27a3f9
New place for the gui-build dir, updated to latest version
Jul 16, 2024
00bc569
show molset command + updated gui launch/shutdown messages
Jul 16, 2024
3462f46
Centralized duplicate normalize_mol_df and _smiles_to_iupac functions…
Jul 16, 2024
048c124
mymols fix
Jul 16, 2024
1fe1256
debugged dataviewer display and updated notebooks
Jul 17, 2024
bac58ea
debugged dataviewer display and updated notebooks
Jul 17, 2024
366b290
enabled append for loading molecules
Jul 17, 2024
7f58266
First step for command
Jul 17, 2024
32dab48
Remove icloud duplicate files
Jul 17, 2024
69c6fe0
formatting and fox new_molecule bug
Jul 18, 2024
d17057e
merge properties bug
Jul 18, 2024
d074b92
gui notebook and readme
Jul 18, 2024
b58a2fe
markdown test
Jul 18, 2024
ab9cd2d
readme & gui demo
Jul 18, 2024
e8722c7
gui readme update
Jul 18, 2024
269aacb
stash
Jul 19, 2024
e88f72a
Support for display molecules from a dataframe
Jul 19, 2024
482134f
stash
Jul 20, 2024
dab1202
prox server major upgrade and debug visuals
Jul 23, 2024
2304190
prox server major upgrade and debug visuals
Jul 23, 2024
45f0c02
prox server major upgrade and debug visuals
Jul 23, 2024
3d54568
stash
Jul 23, 2024
6d71201
Undid renaming gui-build to gui-build-proxy
Jul 23, 2024
e84af5b
paths for routes
Jul 23, 2024
feec921
acheived build
Jul 23, 2024
b00cd3b
merge conflicts mergibg with gui_api_moe
Jul 23, 2024
720480a
merge conflicts mergibg with gui_api_moe #2
Jul 23, 2024
0662173
Merge conflicts #3
themoenen Jul 23, 2024
579e105
Merge conflicts #3
themoenen Jul 23, 2024
6c4c300
Merge wrapup
themoenen Jul 23, 2024
542c2b2
Simplified/cleaned up JL_PROXY proxy code in gui_launcher
themoenen Jul 23, 2024
be3f46d
Demo Notebook design
themoenen Jul 23, 2024
0473f88
Simplified gui_launcher JL_PROXY code
themoenen Jul 23, 2024
7af089b
patch launcher
Jul 24, 2024
5993c52
notebook updates
Jul 24, 2024
11fdaf5
stash
themoenen Jul 24, 2024
1470e7a
gui-build & gui-build-proxy wip
themoenen Jul 24, 2024
3baa40b
Successful build process for gui-build-proxy and gui_launcher.py cleanup
themoenen Jul 24, 2024
c03f305
Updated gui build folders
themoenen Jul 24, 2024
34d0e05
Updated gui build folders
themoenen Jul 24, 2024
1465fb6
New gui build
themoenen Jul 24, 2024
d09049a
notebook upgrade
Jul 24, 2024
17c6c83
fine tuning anf testing
Jul 25, 2024
80f043a
fine tuning anf testing
Jul 25, 2024
bdb8817
added warning for parameters in service call order
Jul 25, 2024
3f8e95e
added warning for parameters in service call order
Jul 25, 2024
9c74674
linter
Jul 25, 2024
50b3342
readme fix
Jul 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ for (var i=0; i< urls.length; i++) {

-->


# OpenAD Beta
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/openad)](https://pypi.org/project/openad/)
[![PyPI version](https://img.shields.io/pypi/v/openad)](https://pypi.org/project/openad/)
[![License MIT](https://img.shields.io/github/license/acceleratedscience/open-ad-toolkit)](https://opensource.org/licenses/MIT)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Docs](https://img.shields.io/badge/website-live-brightgreen)](https://acceleratedscience.github.io/openad-docs/)



**Open Accelerated Discovery Client**<br>
[Documentation](https://acceleratedscience.github.io/openad-docs/)

Expand All @@ -39,17 +42,20 @@ The goal of openAD is to provide a common language for scientists to interact wi

---
> **Pre-install Note:**
For updating to 0.3.0 or above first remove toolkits `remove toolkit DS4SD` and `remove toolkit RXN` prior to updating
For updating to 0.4.0 or above first remove toolkits `remove toolkit DS4SD` and `remove toolkit RXN` prior to updating

> **Whats New ?**
- `%Openadd` has been added to the magic commands to provide pure data type results for data returning commands
- Upgraded IBM BAM model support for latest IBm generative AI embeddings and Langchain
- Upgraded skypilot to 0.6.0
- Support for deploying in OpenSHift AI / Open Data hub workbench or podman/docker image `https://github.com/acceleratedscience/openad_workbench`
- Support for Application API
- Property and Data Set Generation Services
We support the following Model Services
- GT4SD Generation Services `[email protected]:acceleratedscience/generation_inference_service.git`
- GT4SD Property Services `[email protected]:acceleratedscience/property_inference_service.git`
- GT4SD MoleR Generation `[email protected]:acceleratedscience/moler_inference_service.git`
- GT4SD Molformer `[email protected]:acceleratedscience/molformer_inference_service.git`

Pre-Requisite is that you have a AWS Account and can launch your own EC2 Instances Or someone else can launch them for you and you can catalog a Remote Service via URL.

**Example:**
Expand Down
267 changes: 19 additions & 248 deletions _for_testing/Demonstration.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions _for_testing/test_everything.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "ad-venv",
"display_name": "venv",
"language": "python",
"name": "ad-venv"
"name": "venv"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -271,7 +271,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.11.2"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions docs/generate_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from openad.plugins.style_parser import tags_to_markdown
from openad.helpers.output import output_error, output_text, output_success
from openad.helpers.output_msgs import msg
from openad.helpers.general import open_file, write_file
from openad.helpers.files import open_file, write_file

# Get the repo path, this python file's parent folder.
REPO_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
Expand Down Expand Up @@ -202,9 +202,9 @@ def _parse_description(description):
# be treated as part of the blockquote.
description = re.sub(
r"(\*\*Note:\*\*.+?)(\n{1,})",
lambda match: f" > {match.group(1)}\n\n"
if len(match.group(2)) == 1
else f" > {match.group(1)}{match.group(2)}",
lambda match: (
f" > {match.group(1)}\n\n" if len(match.group(2)) == 1 else f" > {match.group(1)}{match.group(2)}"
),
description,
flags=re.MULTILINE,
)
Expand Down
2 changes: 1 addition & 1 deletion docs/output/csv/commands.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ get workspace [ <workspace_name> ];Workspaces
create workspace <workspace_name> [ description('<description>') on path '<path>' ];Workspaces
remove workspace <workspace_name> ;Workspaces
list workspaces;Workspaces
add molecule <name> | <smiles> | <inchi> | <inchikey> | <cid> [ as '<name>' ] [ basic ] [force ];Molecules
add molecule <name> | <smiles> | <inchi> | <inchikey> | <cid> [ as '<name>' ] [ basic ] [ force ];Molecules
display molecule <name> | <smiles> | <inchi> | <inchikey> | <cid>;Molecules
display sources <name> | <smiles> | <inchi> | <inchikey> | <cid>;Molecules
rename molecule <molecule_identifer_string> as <molecule_name>;Molecules
Expand Down
6 changes: 3 additions & 3 deletions docs/output/markdown/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ To update it, see openad/docs/generate_docs.py
- [Search Collections](#search-collections)
- [Collections](#collections)
- [RXN](#rxn)
- [General](#general)
- [General](#general-1)
- [Retrosynthesis](#retrosynthesis)
- [Prediction](#prediction)
- [ST4SD](#st4sd)
Expand Down Expand Up @@ -77,8 +77,8 @@ Lists all your workspaces. <br><br>

### Molecules

`add molecule <name> | <smiles> | <inchi> | <inchikey> | <cid> [ as '<name>' ] [ basic ] [force ]`{: .cmd }
This command is how you add a molecule to a current working list of molecules in memory. When adding a molecule by name, this name will become the molecule's identifying string. <br>
`add molecule <name> | <smiles> | <inchi> | <inchikey> | <cid> [ as '<name>' ] [ basic ] [ force ]`{: .cmd }
This command is how you add a molecule to a current working list of molecules in memory. When adding a molecule by name, this name will become the molecule's identifying string. <br>

It will take any molecules identifier from the following categories: <br>
-`smiles ` <br>
Expand Down
2 changes: 1 addition & 1 deletion openad/app/magic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from openad.app.magic.openad import AD
from openad.app.magic.openad_magic import AD


def load_ipython_extension(ipython):
Expand Down
54 changes: 40 additions & 14 deletions openad/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
import uuid
from cmd import Cmd
from pandas import DataFrame
import atexit

# Main
from openad.app.main_lib import lang_parse, initialise, set_context, unset_context
from openad.toolkit.toolkit_main import load_toolkit
from openad.app import login_manager
from openad.gui.gui_launcher import gui_init, GUI_SERVER, gui_shutdown
from openad.gui.ws_server import ws_server # Web socket server for gui - experimental
from openad.helpers.output import output_table

# Core
Expand All @@ -41,6 +44,7 @@
from openad.helpers.output_msgs import msg
from openad.helpers.general import refresh_prompt
from openad.helpers.splash import splash
from openad.helpers.files import empty_trash
from openad.helpers.output_content import info_workspaces, info_toolkits, info_runs, info_context

# Globals
Expand All @@ -57,6 +61,7 @@
import inspect
import importlib


MAGIC_PROMPT = None
PLUGIN_CLASS_LIST = []
installed_packages = pkg_resources.working_set
Expand Down Expand Up @@ -138,19 +143,6 @@ class RUNCMD(Cmd):
molecule_list = []
last_external_molecule = None

def workspace_path(self, workspace: str):
"""Returns the default workspace directory path"""
try:
x = os.path.expanduser(self.settings["paths"][workspace.upper()] + "/" + workspace.upper())
return x
except Exception: # pylint: disable=broad-exception-caught
# various exceptions can cause this... Any error results in same outcome
return os.path.expanduser(_meta_workspaces + "/" + workspace.upper())

def set_workspace_path(self, workspace: str, path: str):
"""Sets the current workspace path in the settings dictionary"""
self.settings["paths"][workspace.upper()] = os.path.expanduser(path)

# Initialises the class for Run command.
def __init__(self, completekey="Tab", api=False):
super().__init__()
Expand Down Expand Up @@ -215,6 +207,20 @@ def __init__(self, completekey="Tab", api=False):

output_train_statements(self)

def workspace_path(self, workspace: str = None):
"""Returns the default workspace directory path"""
workspace = workspace.upper() if workspace else self.settings["workspace"].upper()
try:
x = os.path.expanduser(self.settings["paths"][workspace.upper()] + "/" + workspace.upper())
return x
except Exception: # pylint: disable=broad-exception-caught
# various exceptions can cause this... Any error results in same outcome
return os.path.expanduser(_meta_workspaces + "/" + workspace.upper())

def set_workspace_path(self, workspace: str, path: str):
"""Sets the current workspace path in the settings dictionary"""
self.settings["paths"][workspace.upper()] = os.path.expanduser(path)

def do_help(self, inp, display_info=True, starts_with_only=False, **kwargs):
"""CMD class called function:
Display help about a command, for example 'list'.
Expand Down Expand Up @@ -605,8 +611,13 @@ def complete(self, text, state):
# Catches the exit command
def do_exit(self, dummy_inp_do_not_remove):
"""CMD Funcion: called on exit command"""
try:
cleanup()
except:
pass
write_registry(self.settings, self, True)
delete_session_registry(self.session_id)

# exiting the application. Shorthand: x q.
return True

Expand Down Expand Up @@ -821,7 +832,7 @@ def error_first_word_grabber(error):
return str(word)


# Main execution application
# Main execution application.
# If the application is called with parameters, it executes the parameters.
# If called without parameters, the command line enters the shell environment.
# History is only kept for commands executed once in the shell.
Expand All @@ -844,6 +855,7 @@ def api_remote(
- It is deliberate that the whole RUNCMD class object is not kept alive as there is no logical
exit point for magic commands, unlike a command line.
"""

global MAGIC_PROMPT
# GLOBAL_SETTINGS["display"] = "notebook"

Expand All @@ -859,6 +871,7 @@ def api_remote(
MAGIC_PROMPT = magic_prompt
else:
magic_prompt = MAGIC_PROMPT

if api_context["workspace"] is None:
api_context["workspace"] = magic_prompt.settings["workspace"]
else:
Expand Down Expand Up @@ -938,6 +951,9 @@ def cmd_line():
a_space = " "
try:
command_line = RUNCMD()
# Launch the GUI if it is installed.
# gui_init(command_line)
# ws_server(command_line) # Experimental
except KeyboardInterrupt:
output_error(msg("err_key_exit_before_init"))
return
Expand Down Expand Up @@ -1000,15 +1016,25 @@ def cmd_line():
# The cmdloop parameter controls the startup screen, it overrides self.intro.
command_line.cmdloop(splash(command_line.settings["context"], command_line, startup=True))
lets_exit = True

except KeyboardInterrupt:
command_line.postloop()

if confirm_prompt("Are you sure you wish to exit?", default=True):
# from openad.gui.gui_launcher import gui_shutdown
empty_trash(command_line)
lets_exit = True
command_line.do_exit("dummy do not remove")

except Exception as err: # pylint: disable=broad-exception-caught
# We do not know what the error could be, so no point in being more specific.
output_error(msg("err_invalid_cmd", err), command_line)


def cleanup():
gui_shutdown(ignore_warning=True)


atexit.register(cleanup)
if __name__ == "__main__":
cmd_line()
Loading
Loading