Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .readthedocs.yaml

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include src/ilthermopy/data/*
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
author = 'Ivan Yu. Chernyshov'

# The full version, including alpha/beta/rc tags
release = '1.0.0'
release = '1.1.1'


# -- General configuration ---------------------------------------------------
Expand Down
12 changes: 12 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Changelog
=========

1.1.1
-----

* Adds small code fixes.

* Migrates package info from ``setup.cfg`` to ``pyproject.toml``.

* Changes layout to ``src``.

* Adds tests.


1.1.0
-----

Expand Down
145 changes: 114 additions & 31 deletions docs/source/cookbook.ipynb

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "ilthermopy"
authors = [
{name = "Ivan Yu. Chernyshov", email = "ivan.chernyshoff@gmail.com"}
]
maintainers = [
{name = "Ivan Yu. Chernyshov", email = "ivan.chernyshoff@gmail.com"}
]
description = "A simple Python wrapper around the ILThermo 2.0 database with SMILES support"
license = {file = "LICENSE"}
keywords = ["ionic liquids", "ilthermo", "nist", "api"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3 :: Only",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Chemistry",
]
dependencies = [
"importlib-resources>=1.1.0; python_version<'3.9'",
"requests",
"pandas"
]
requires-python = ">= 3.7"
dynamic = ["version", "readme"]

[project.urls]
documentation = "https://ivanchernyshov.github.io/ILThermoPy/"
repository = "https://github.com/IvanChernyshov/ILThermoPy.git"
issues = "https://github.com/IvanChernyshov/ILThermoPy/issues"

[tool.setuptools.dynamic]
version = {attr = "ilthermopy.__version__"}
readme = {file = "README.md"}


35 changes: 0 additions & 35 deletions setup.cfg

This file was deleted.

4 changes: 2 additions & 2 deletions ilthermopy/__init__.py → src/ilthermopy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

'''

__version__ = '1.1.0'
__updated__ = 'September 06, 2024'
__version__ = '1.1.1'
__updated__ = 'May 03, 2025'
__license__ = 'MIT'


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def GetSavedCompounds() -> Compounds:
'''
# read data
pkg = _importlib_resources.files('ilthermopy')
data_file = pkg / 'compounds.csv'
data_file = pkg / 'data' / 'compounds.csv'
with _importlib_resources.as_file(data_file) as path:
data = _pd.read_csv(path)
# prepare data
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions ilthermopy/data_structs.py → src/ilthermopy/data_structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class PropertyList():
'''

def __init__(self):
self.response = _req.GetPropertyList()
self._response = _req.GetPropertyList()
try:
self.properties = {item['cls'].strip(): {k.strip(): v.strip() for k, v in zip(item['key'], item['name'])} for item in self.response['plist']}
self.properties = {item['cls'].strip(): {k.strip(): v.strip() for k, v in zip(item['key'], item['name'])} for item in self._response['plist']}
self.key2prop = {k: v for name, lst in self.properties.items() for k, v in lst.items()}
self.prop2key = {v: k for k, v in self.key2prop.items()}
except (KeyError, AttributeError, TypeError, ValueError):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
34 changes: 34 additions & 0 deletions tests/test_ilthermopy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
'''Unit tests for the ilthermopy package'''

import ilthermopy as ilt


class TestData:

def test_properties(self):
props = ilt.PropertyList()
assert props
assert props.prop2key['Activity']

def test_entries(self):
df = ilt.GetAllEntries()
assert len(df) > 54000 # no distinct numbers due to possible updates

def test_compounds(self):
cmps = ilt.GetSavedCompounds().data
assert len(cmps) > 4000


class TestSearch:

def test_property_search(self):
df = ilt.Search(n_compounds=3, prop='Activity', year=2010)
assert len(df) > 0

def test_retrieving_entry(self):
df = ilt.Search(n_compounds=3, prop='Activity', year=2010)
entries = [ilt.GetEntry(idx) for idx in df['id']]
assert entries[0].components[0]
assert entries[0].components[0].smiles


Loading