Skip to content

Commit 864799f

Browse files
Merge pull request #17 from SalvadorBrandolin/main
ugropy 2.0.0
2 parents 973f5e1 + 7efb9c5 commit 864799f

File tree

161 files changed

+4785
-2728
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+4785
-2728
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
python-version: ['3.10', '3.11']
15+
python-version: ['3.10', '3.11', '3.12']
1616

1717
steps:
1818
- uses: actions/checkout@master

.readthedocs.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
<!-- omit in toc -->
2+
# Contributing to ugropy
3+
4+
First off, thanks for taking the time to contribute! ❤️
5+
6+
All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉
7+
8+
> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
9+
> - Star the project
10+
> - Tweet about it
11+
> - Refer this project in your project's readme
12+
> - Mention the project at local meetups and tell your friends/colleagues
13+
14+
<!-- omit in toc -->
15+
## Table of Contents
16+
17+
- [I Have a Question](#i-have-a-question)
18+
- [I Want To Contribute](#i-want-to-contribute)
19+
- [Reporting Bugs](#reporting-bugs)
20+
- [Suggesting Enhancements](#suggesting-enhancements)
21+
- [Your First Code Contribution](#your-first-code-contribution)
22+
- [Improving The Documentation](#improving-the-documentation)
23+
- [Styleguides](#styleguides)
24+
- [Commit Messages](#commit-messages)
25+
- [Join The Project Team](#join-the-project-team)
26+
27+
28+
29+
## I Have a Question
30+
31+
> If you want to ask a question, we assume that you have read the available [Documentation](https://ipqa-research.github.io/ugropy/).
32+
33+
Before you ask a question, it is best to search for existing [Issues](https://github.com/ipqa-research/ugropy/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.
34+
35+
If you then still feel the need to ask a question and need clarification, we recommend the following:
36+
37+
- Open an [Issue](https://github.com/ipqa-research/ugropy/issues/new).
38+
- Provide as much context as you can about what you're running into.
39+
- Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant.
40+
41+
We will then take care of the issue as soon as possible.
42+
43+
<!--
44+
You might want to create a separate issue tag for questions and include it in this description. People should then tag their issues accordingly.
45+
46+
Depending on how large the project is, you may want to outsource the questioning, e.g. to Stack Overflow or Gitter. You may add additional contact and information possibilities:
47+
- IRC
48+
- Slack
49+
- Gitter
50+
- Stack Overflow tag
51+
- Blog
52+
- FAQ
53+
- Roadmap
54+
- E-Mail List
55+
- Forum
56+
-->
57+
58+
## I Want To Contribute
59+
60+
> ### Legal Notice <!-- omit in toc -->
61+
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.
62+
63+
### Reporting Bugs
64+
65+
<!-- omit in toc -->
66+
#### Before Submitting a Bug Report
67+
68+
A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.
69+
70+
- Make sure that you are using the latest version.
71+
- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://ipqa-research.github.io/ugropy/). If you are looking for support, you might want to check [this section](#i-have-a-question)).
72+
- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/ipqa-research/ugropyissues?q=label%3Abug).
73+
- Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
74+
- Collect information about the bug:
75+
- Stack trace (Traceback)
76+
- OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
77+
- Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant.
78+
- Possibly your input and the output
79+
- Can you reliably reproduce the issue? And can you also reproduce it with older versions?
80+
81+
<!-- omit in toc -->
82+
#### How Do I Submit a Good Bug Report?
83+
84+
> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to <[email protected]>.
85+
<!-- You may add a PGP key to allow the messages to be sent encrypted as well. -->
86+
87+
We use GitHub issues to track bugs and errors. If you run into an issue with the project:
88+
89+
- Open an [Issue](https://github.com/ipqa-research/ugropy/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.)
90+
- Explain the behavior you would expect and the actual behavior.
91+
- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
92+
- Provide the information you collected in the previous section.
93+
94+
Once it's filed:
95+
96+
- The project team will label the issue accordingly.
97+
- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced.
98+
- If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be [implemented by someone](#your-first-code-contribution).
99+
100+
<!-- You might want to create an issue template for bugs and errors that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. -->
101+
102+
103+
### Suggesting Enhancements
104+
105+
This section guides you through submitting an enhancement suggestion for ugropy, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.
106+
107+
<!-- omit in toc -->
108+
#### Before Submitting an Enhancement
109+
110+
- Make sure that you are using the latest version.
111+
- Read the [documentation](https://ipqa-research.github.io/ugropy/) carefully and find out if the functionality is already covered, maybe by an individual configuration.
112+
- Perform a [search](https://github.com/ipqa-research/ugropy/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
113+
- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.
114+
115+
<!-- omit in toc -->
116+
#### How Do I Submit a Good Enhancement Suggestion?
117+
118+
Enhancement suggestions are tracked as [GitHub issues](https://github.com/ipqa-research/ugropy/issues).
119+
120+
- Use a **clear and descriptive title** for the issue to identify the suggestion.
121+
- Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
122+
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you.
123+
- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. <!-- this should only be included if the project has a GUI -->
124+
- **Explain why this enhancement would be useful** to most ugropy users. You may also want to point out the other projects that solved it better and which could serve as inspiration.
125+
126+
<!-- You might want to create an issue template for enhancement suggestions that can be used as a guide and that defines the structure of the information to be included. If you do so, reference it here in the description. -->
127+
128+
### Your First Code Contribution
129+
<!-- TODO
130+
include Setup of env, IDE and typical getting started instructions?
131+
132+
-->
133+
134+
### Improving The Documentation
135+
<!-- TODO
136+
Updating, improving and correcting the documentation
137+
138+
-->
139+
140+
## Styleguides
141+
### Commit Messages
142+
<!-- TODO
143+
144+
-->
145+
146+
## Join The Project Team
147+
<!-- TODO -->
148+
149+
<!-- omit in toc -->
150+
## Attribution
151+
This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)!

MANIFEST.in

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
include LICENCE
22
include README.md
3+
include CONTRIBUTING.md
34
include requirements.txt
45
include pyproject.toml
56

67
recursive-include ugropy *.py *.csv
78

89
exclude tox.ini
9-
exclude .readthedocs.yml
1010
exclude requirements-dev.txt
11-
exclude *.png
11+
exclude *.svg
1212
exclude binder.ipynb
1313
exclude reminder.md
1414

1515
recursive-exclude dist *
1616
recursive-exclude tests *
1717
recursive-exclude docs *
18-
recursive-exclude tools *

README.md

Lines changed: 64 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,68 @@
1-
<p align="center">
2-
<img src="logo.png" alt="logo" width="300" height="350">
3-
</p>
1+
![logo](logo.svg)
42

53
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ipqa-research/ugropy/main)
64
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://tldrlegal.com/license/mit-license)
75
![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B-blue)
86
[![Docs](https://img.shields.io/badge/docs%20-%20green?style=flat&label=Sphinx&link=https%3A%2F%2Fipqa-research.github.io%2Fugropy%2Findex.html)](https://salvadorbrandolin.github.io/ugropy/)
9-
[![PyPI version](https://badge.fury.io/py/ugropy.svg)](https://badge.fury.io/py/ugropy)
10-
11-
ugropy is a `Python` library to obtain the UNIFAC's subgroups from both the
12-
name or the SMILES representation of a molecule. If the name is given, the
13-
library uses the [PubChemPy](https://github.com/mcs07/PubChemPy) library tov
14-
obtain the SMILES representation from PubChem. In both cases, ugropy uses the
7+
[![PyPI
8+
version](https://badge.fury.io/py/ugropy.svg)](https://badge.fury.io/py/ugropy)
9+
10+
`ugropy` is a `Python` library to obtain subgroups from different
11+
thermodynamic group contribution models using both the name or the SMILES
12+
representation of a molecule. If the name is given, the library uses the
13+
[PubChemPy](https://github.com/mcs07/PubChemPy) library to obtain the SMILES
14+
representation from PubChem. In both cases, `ugropy` uses the
1515
[RDKit](https://github.com/rdkit/rdkit) library to search the functional groups
1616
in the molecule.
1717

18-
ugropy is in an early development stage, leaving issues of examples of
19-
molecules that ugropy fails solving the UNIFAC's groups is very helpful.
18+
`ugropy` is in an early development stage, leaving issues of examples of
19+
molecules that `ugropy` fails solving the subgroups of a model is very helpful.
2020

2121
## Try ugropy now
22-
You can try ugropy from it's
22+
You can try ugropy from its
2323
[Binder](https://mybinder.org/v2/gh/ipqa-research/ugropy/main). Open the
2424
binder.ipynb file to explore the basic features.
2525

26-
## Models supported v1.0.1
26+
## Models supported v2.0.0
2727
- Classic liquid-vapor UNIFAC
2828
- Predictive Soave-Redlich-Kwong (PSRK)
2929
- Joback
3030

3131
## Writers
3232

33-
- Clapeyron.jl
33+
- [Clapeyron.jl](github.com/ClapeyronThermo/Clapeyron.jl)
34+
- [Thermo](https://github.com/CalebBell/thermo)
3435

3536

3637
## Example of use
37-
You can check the full tutorial
38+
You can check the full tutorial
3839
[here](https://ipqa-research.github.io/ugropy/tutorial/tutorial.html).
3940

40-
Get UNIFAC groups from the molecule's name:
41+
Get groups from the molecule's name:
4142

4243
```python
4344
from ugropy import Groups
4445

4546

4647
hexane = Groups("hexane")
4748

48-
print(hexane.unifac_groups)
49-
print(hexane.psrk_groups)
50-
print(hexane.joback.groups)
49+
print(hexane.unifac.subgroups)
50+
print(hexane.psrk.subgroups)
51+
print(hexane.joback.subgroups)
5152
```
5253

5354
{'CH3': 2, 'CH2': 4}
5455
{'CH3': 2, 'CH2': 4}
5556
{'-CH3': 2, '-CH2-': 4}
5657

57-
Get UNIFAC groups from molecule's SMILES:
58+
Get groups from molecule's SMILES:
5859

5960
```python
6061
propanol = Groups("CCCO", "smiles")
6162

62-
print(propanol.unifac_groups)
63-
print(propanol.psrk_groups)
64-
print(propanol.joback.groups)
63+
print(propanol.unifac.subgroups)
64+
print(propanol.psrk.subgroups)
65+
print(propanol.joback.subgroups)
6566
```
6667

6768
{'CH3': 1, 'CH2': 2, 'OH': 1}
@@ -73,7 +74,7 @@ Estimate properties with the Joback model!
7374
```python
7475
limonene = Groups("limonene")
7576

76-
print(limonene.joback.groups)
77+
print(limonene.joback.subgroups)
7778
print(f"{limonene.joback.critical_temperature} K")
7879
print(f"{limonene.joback.vapor_pressure(176 + 273.15)} bar")
7980
```
@@ -82,6 +83,24 @@ print(f"{limonene.joback.vapor_pressure(176 + 273.15)} bar")
8283
657.4486692170663 K
8384
1.0254019428522743 bar
8485

86+
Visualize your results! (The next code creates the `ugropy` logo)
87+
88+
```Python
89+
from IPython.display import SVG
90+
91+
mol = Groups("CCCC1=C(COC(C)(C)COC(=O)OCC)C=C(CC2=CC=CC=C2)C=C1", "smiles")
92+
93+
svg = mol.unifac.draw(
94+
title="ugropy",
95+
width=800,
96+
height=450,
97+
title_font_size=50,
98+
legend_font_size=14
99+
)
100+
101+
SVG(svg)
102+
```
103+
85104
Write down the [Clapeyron.jl](https://github.com/ClapeyronThermo/Clapeyron.jl)
86105
.csv input files.
87106

@@ -95,12 +114,27 @@ grps = [Groups(n) for n in names]
95114
# Write the csv files into a database directory
96115
writers.to_clapeyron(
97116
molecules_names=names,
98-
unifac_groups=[g.unifac_groups for g in grps],
99-
psrk_groups=[g.psrk_groups for g in grps],
117+
unifac_groups=[g.unifac.subgroups for g in grps],
118+
psrk_groups=[g.psrk.subgroups for g in grps],
100119
joback_objects=[g.joback for g in grps],
101120
path="./database"
102121
)
103122
```
123+
Obtain the [Caleb Bell's Thermo](https://github.com/CalebBell/thermo) subgroups
124+
125+
```python
126+
from ugropy import unifac
127+
128+
names = ["hexane", "2-butanone"]
129+
130+
grps = [Groups(n) for n in names]
131+
132+
[writers.to_thermo(g.unifac.subgroups, unifac) for g in grps]
133+
```
134+
135+
```
136+
[{1: 2, 2: 4}, {1: 1, 2: 1, 18: 1}]
137+
```
104138

105139
## Installation
106140
```
@@ -119,9 +153,9 @@ PROPERTIES FROM GROUP-CONTRIBUTIONS. Chemical Engineering Communications,
119153
property values [Thesis (Ph. D.), Massachusetts Institute of Technology].
120154
https://dspace.mit.edu/handle/1721.1/14191
121155

122-
[4] Bondi, A. (1966). Estimation of Heat Capacity of Liquids.
123-
Industrial & Engineering Chemistry Fundamentals, 5(4), 442–449.
156+
[4] Bondi, A. (1966). Estimation of Heat Capacity of Liquids. Industrial &
157+
Engineering Chemistry Fundamentals, 5(4), 442–449.
124158
https://doi.org/10.1021/i160020a001
125159

126-
[5] Rowlinson, J. S., & Swinton, F. (2013). Liquids and liquid
127-
mixtures: Butterworths monographs in chemistry. Butterworth-Heinemann
160+
[5] Rowlinson, J. S., & Swinton, F. (2013). Liquids and liquid mixtures:
161+
Butterworths monographs in chemistry. Butterworth-Heinemann

0 commit comments

Comments
 (0)