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

Mini Games #179

Draft
wants to merge 57 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
63bb601
add sign-in/up page
GalMunGral Mar 13, 2024
cd7c0d4
disable password feedback for login
GalMunGral Mar 13, 2024
8d30f4a
add group cart feature
GalMunGral Mar 14, 2024
2f7ae94
add group cart feature
GalMunGral Mar 14, 2024
f696254
use generated join codes
GalMunGral Mar 19, 2024
c2c22d6
increase Angular budget (again)
GalMunGral Mar 19, 2024
3a341b3
copy SVG animations from splash screen
GalMunGral Mar 19, 2024
c17f064
increase Angular budget (again x2)
GalMunGral Mar 19, 2024
71c5c82
add trailing slash for request url
GalMunGral Mar 19, 2024
045a807
update panel styles
GalMunGral Mar 28, 2024
49a6a59
update panel styles
GalMunGral Mar 28, 2024
cada019
add list view & comparison view
GalMunGral Mar 28, 2024
ac986fc
increase angular budget (again)
GalMunGral Mar 28, 2024
62f2de3
add block library page
GalMunGral Apr 10, 2024
c76f81e
update navigation flow & header
GalMunGral Apr 11, 2024
750e3a5
personal cart persistence
GalMunGral Apr 12, 2024
79267d7
close menu when clicking outside
GalMunGral Apr 12, 2024
551df4d
small UX improvements
GalMunGral Apr 12, 2024
9bff336
add support for touchscreens
GalMunGral Apr 15, 2024
7b70d3d
move molecule details to side panel
GalMunGral Apr 18, 2024
81d49a4
replace PATCH with PUT for now
GalMunGral Apr 18, 2024
216011c
add guest mode
GalMunGral Apr 18, 2024
9e8fd1b
add confirmation modal
GalMunGral Apr 22, 2024
ef0e598
move toggle button & fix reset button
GalMunGral Apr 22, 2024
4e19d71
prevent triggering detail view when removing blocks
GalMunGral Apr 22, 2024
b3cecc1
implement pinch zoom gesture
GalMunGral Apr 22, 2024
3f514a5
add SVGs to detail view
GalMunGral Apr 23, 2024
4508520
fix exit dialog logic
GalMunGral Apr 23, 2024
fd0d425
clean up SVGs
GalMunGral Apr 25, 2024
7b4e738
add block library card images
GalMunGral Apr 25, 2024
4c96d5b
enable fullscreen mode for 2D/3D viz
GalMunGral Apr 25, 2024
933d94d
fix pointer-tracking logic
GalMunGral Apr 26, 2024
95ddb8e
fix detail panel stale state
GalMunGral Apr 26, 2024
dcc77ba
consolidate `workspaceService` and `cartService`
GalMunGral Apr 26, 2024
26350e1
consolidate `workspaceService` and `cartService`
GalMunGral Apr 26, 2024
c29a8c6
enable transfer of molecules between personal and group carts
GalMunGral Apr 30, 2024
16cd45c
change text wording
GalMunGral May 1, 2024
c418561
add links to tutorial videos
GalMunGral May 14, 2024
dcddabc
remove multi-molecule support
GalMunGral May 14, 2024
8a36aa7
add preconnect hint
GalMunGral May 14, 2024
ae56d83
add tutorial text
GalMunGral May 16, 2024
4e1e05f
add an admin page for submitting synthesis requests
GalMunGral May 20, 2024
eb2a352
add more columns to admin table
GalMunGral May 20, 2024
5883a43
rename synthesis endpoint
GalMunGral May 20, 2024
b0c4ca3
remove dead code
GalMunGral May 21, 2024
3da206b
inject HTTP header through interceptor
GalMunGral May 21, 2024
92e3f99
fix unit tests
GalMunGral May 21, 2024
29e4e39
display user & group names in admin table
GalMunGral May 22, 2024
ba21f69
add help link
GalMunGral May 29, 2024
472d3a9
add initial proof-of-concept
GalMunGral May 30, 2024
72c5681
update styles
GalMunGral May 30, 2024
0dcfea1
replace XYZ curves with LMS
GalMunGral May 30, 2024
ffa133f
update styles
GalMunGral May 30, 2024
ee82743
generate OPV blocks
GalMunGral Jun 7, 2024
41228c2
rename smiles directory
GalMunGral Jun 7, 2024
6f30cbb
add SMILES for color wheel
GalMunGral Jun 7, 2024
c07f99a
reprocess block set data
GalMunGral Jun 7, 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
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1.5mb"
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "14kb"
"maximumError": "15kb"
}
],
"fileReplacements": [
Expand Down
126 changes: 125 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ python = "^3.12"
pandas = "^2.2.1"
openpyxl = "^3.1.2"
numpy = "^1.26.4"
rdkit = "^2023.9.6"


[build-system]
Expand Down
47 changes: 41 additions & 6 deletions scripts/process_color_wheel.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import itertools
import json
import os
from rdkit.Chem.Descriptors import MolWt
from rdkit.Chem import CanonSmiles, MolFromSmiles
from rdkit.Chem.rdMolDescriptors import CalcMolFormula

from utils import get_svg_dimensions, combine_chemical_formulas, combine
from utils import get_svg_dimensions, naive_combine

workdir = './src/assets/blocks/10x10x10palette'

with open(os.path.join(workdir, 'blocks.json')) as file:
with open(os.path.join(workdir, 'block_set.json')) as file:
block_set = json.load(file)

blocks_by_index = [[None], [None], [None]]
Expand All @@ -31,6 +34,29 @@ def process_blocks():
block_set['blocks'] = processed_blocks


def get_smiles(donor, bridge, acceptor):
"""
Returns SMILES of either a single block or a full 3-block combo
"""
blocks = [donor, bridge, acceptor]
blocks = [block for block in blocks if block]

if len(blocks) == 1:
return CanonSmiles(blocks[0]['properties']['smiles'])

if not donor or not bridge or not acceptor:
return ''

start = chr(ord('A') + (donor['id'] - 1))
mid = bridge['id']
end = chr(ord('K') + (acceptor['id'] - 1))

filename = workdir + f'/smi/{start}_{mid}_{end}.smi'
with open(filename) as f:
smiles = f.read().strip()
return smiles


def generate_lookup_table():
block_set['table'] = {}

Expand All @@ -40,12 +66,21 @@ def generate_lookup_table():
a_id = acceptor['id'] if acceptor else 0
key = f'{d_id}:{b_id}:{a_id}'

smiles = get_smiles(donor, bridge, acceptor)
chemical_formula = CalcMolFormula(MolFromSmiles(smiles))

all_smiles = [block['properties']['smiles'] if block else '' for block in (donor, bridge, acceptor)]

block_set['table'][key] = {
'key': key,
'chemicalFormula': combine_chemical_formulas(donor, bridge, acceptor),
'smiles': combine('smiles', '')(donor, bridge, acceptor),
'lambdaMaxShift': combine('lambdaMaxShift', 0)(donor, bridge, acceptor),
'molecularWeight': combine('molecularWeight', 0)(donor, bridge, acceptor),
'chemicalFormula': chemical_formula.replace('+', '').replace('-', ''),
'smiles': smiles,
'lambdaMaxShift': (
(donor['properties']['lambdaMaxShift'] if donor else 0)
+ (bridge['properties']['lambdaMaxShift'] if bridge else 0)
+ (acceptor['properties']['lambdaMaxShift'] if acceptor else 0)
),
'molecularWeight': MolWt(naive_combine(all_smiles))
}


Expand Down
Loading
Loading