Mols2grid

Latest version: v2.0.0

Safety actively analyzes 624395 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

2.0.0

This release is a major change on the UI contributed by themoenen, refer to
[PR55](https://github.com/cbouy/mols2grid/pull/55) for the full list of changes:

Added
- `background_color="white"` parameter added to `display` and `save` to control the background
color of each cell.
- Property values displayed via subset or tooltip can now be copied by clicking them.

Changed
- Responsiveness: the grid as well as all UI components are now fully responsive, up until around
~415px wide. Smaller usage seems unlikely.
- `n_items_per_page` replaces the `n_rows` and `n_cols` parameters. The responsive CSS assumes
results to be a multiple of 12, otherwise a gap is displayed at the end of the grid.
- Hover tooltips: now displayed when hovering the *`i`* icon, and anchored by clicking this icon.
- Save CVS: When exporting as CSV we now use a semicolon `;` as delineator instead of a tab, this
way CSVs are properly previewed on Mac.
- Templates: the `pages`/`table` templates and corresponding functions have been renamed to
`interactive`/`static` for clarity.
- Parameters `width` and `height` have been renamed to `iframe_width` and `iframe_height` to be more
descriptive.
- Improved the sorting UI to be more intuitive.
- You can now toggle between text/SMARTS search instead of having to click a dropdown.
- The checkbox menu icon was replaced with a more standard triple dot menu.
- The mols2grid-id is now permanently displayed next to the checkbox in the corner.
- SVGs are now rendered with a transparent background.
- The entire cell is now clickable, instead of just the tiny checkbox.
- Implemented some basic keyboard navigation: ENTER / ESC for selecting / unselecting, arrows and
TAB for navigation.
- Copy to clipboard: this will now record a tab delineated text which is ready to be pasted into a
spreadsheet, instead of the less useful dictionary format.
- The `tooltip_trigger` parameter has been removed since callback and hover functionalities don't
overlap anymore.
- We're now automatically adding `"img"` to the subset instead of throwing an error.
- A smaller default font size (12px) makes the experience out of the box a bit more practical.

Fixed
- Docstring now mention default values and some inconsistencies have been fixed.
- All UI elements are now neatly aligned and displayed on top so they're accessible without
scrolling.
- Longer property values are now only truncated in the interactive grid, and broken into multiple
lines by default in the static grid, as it is mostly meant for printing. A new parameter
`truncate` lets you override the default truncating behavior.
- The tooltip display zone (around which the tooltip is displayed) is now the entire cell instead
of only the image, so it never overlaps with any of the cell's data or functionality.
- When you download a CSV or SMILES file without any cells selected, you will now download data for
all cells instead of an empty document.
- Parameter `gap` in static template didn't work.
- We no longer resize the iframe if a custom `iframe_height` is set by the display function.

---

1.1.1

Added
- Support for `pathlib.Path` objects as input for `display`, `save`, `MolGrid.from_sdf`
and `sdf_to_dataframe`.

Changed
- The hover tooltip placement has been changed from `"bottom"` to `"auto"`.
- Code and notebook formatting with `black` and `isort`.
- Switched to `hatchling` for the build process, `tbump` for versioning, and migrated to
using only the `pyproject.toml` file.
- Refactored tests to use Pytest's `contest.py` file.

Fixed
- CSV export when sorting the grid was not using the selected molecules.

---

1.1.0

Added
- Predefined JavaScript callbacks in the `mols2grid.callbacks` module. Those can be
extensively configured:
- `info`: displays a bigger image alongside some common descriptors for the molecule
- `show_3d`: displays the molecule in 3D
- `external_link`: opens a new tab. By default, opens [Leruli.com](https://leruli.com/)
using the SMILES of the molecule.
- Support for `tuple` of molecules in `display` and `save`.

Changed
- The `"click"` event is now automatically removed from `tooltip_trigger` when
specifying a callback.

Fixed
- Text searches containing any of the following regex characters `-[]{}()*+?.,\^$|`
would automatically return an empty grid, preventing searching for CAS numbers and any
other identifier or text containing the above characters. This has been temporarily
patched until a proper fix is released in the underlying `list.js` library.
- The link to the KNIME component on the corresponding badges has been fixed.

1.0.0

Added
- Notebooks running in VSCode and Jupyter Lab now support accessing selections from
Python, executing Python callback functions, and filtering based on other widgets.
Changed
- Python callbacks can now also be `lambda` functions.
- If ``prerender=True``, substructure highlighting will be automatically disabled by
default instead of raising an error.
- When exporting a selection to a SMILES file through the GUI, the output no longer
contains a header.
- Relies on a custom ipywidget to handle communication between the front-end/Javascript
and the back-end/Python.
- When calling `grid.filter` and other filtering methods, mols2grid will now use the
filtering code based on ipywidgets, except for Streamlit where it will use the older
JavaScript version of the code to maintain compatibility.
Fixed
- Automatically fitting to the content's height in Streamlit.
Removed
- `mapping` argument for renaming fields, replaced by `rename` in `v0.1.0`.
- `mols2grid.selection`, replaced by `mols2grid.get_selection()` in `v0.1.0`.

0.2.4

Fixed
- Calling `MolGrid.get_selection()` when 2 grids with different names are present should
now display the selection of the grid itself, and not the selection corresponding to
indices of the grid that was last interacted with.

0.2.3

Fixed
- Doing a substructure search on molecules with explicit hydrogens should now highlight
the correct atoms.

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.