File tree Expand file tree Collapse file tree 4 files changed +14
-6
lines changed
Expand file tree Collapse file tree 4 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
55and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
66
7+ ## [ 0.2.4] - 2022/05/??
8+ ### Fixed
9+ - Calling ` MolGrid.get_selection() ` when 2 grids with different names are present should
10+ now display the selection of the grid itself, and not the selection corresponding to
11+ indices of the grid that was last interacted with.
12+
713## [ 0.2.3] - 2022/05/10
814### Fixed
915- Doing a substructure search on molecules with explicit hydrogens should now highlight
Original file line number Diff line number Diff line change 1- __version__ = "0.2.3 "
1+ __version__ = "0.2.4 "
Original file line number Diff line number Diff line change @@ -627,7 +627,7 @@ def get_selection(self):
627627 -------
628628 pandas.DataFrame
629629 """
630- sel = list (register .get_selection ().keys ())
630+ sel = list (register .get_selection (self . _grid_id ).keys ())
631631 return (self .dataframe .loc [self .dataframe ["mols2grid-id" ].isin (sel )]
632632 .drop (columns = self ._extra_columns ))
633633
Original file line number Diff line number Diff line change @@ -215,11 +215,13 @@ def test_mol_to_img_png():
215215 assert img .startswith ('<img src="data:image/png;base64' )
216216
217217def test_get_selection (df ):
218- grid = MolGrid (df , mol_col = "mol" )
218+ grid = MolGrid (df , mol_col = "mol" , name = "grid" )
219+ other = MolGrid (df , mol_col = "mol" , name = "other" )
220+ register ._update_current_grid ("grid" )
219221 register ._set_selection (0 , "" )
220- new = grid .get_selection ()
221- assert_equal ( new . values ,
222- df . iloc [ 0 : 1 ]. values )
222+ assert grid .get_selection (). equals ( df . head ( 1 ) )
223+ assert other . get_selection (). equals ( df . head ( 0 )) # empty dataframe
224+ register . _clear ( )
223225
224226def test_save (grid_otf ):
225227 with NamedTemporaryFile ("w" , suffix = ".html" ) as f :
You can’t perform that action at this time.
0 commit comments