187 Commits

Author SHA1 Message Date
Xiang Zhong
7702b2bc44 update interface pybel.py (#2509)
* update interface pybel.py & testpybel.py
2022-08-04 10:23:50 -04:00
Geoff Hutchison
18665b94fe Merge pull request #2466 from e-kwsm/IOError
python: replace IOError with OSError
2022-06-09 18:35:15 -04:00
Eisuke Kawashima
0f4af753d4 test(python): improve usages of unitest.TestCase methods 2022-04-27 13:26:48 +09:00
Eisuke Kawashima
77530fb0aa python: replace IOError with OSError
https://peps.python.org/pep-3151/
2022-04-25 16:37:29 +09:00
dkoes
f68dbd4a7f Fix missing atom pybel properties.
Some properties (e.g. implicitvalence) are no longer available.
Also added index as a property and a test.
2020-10-26 21:43:32 -04:00
Noel O'Boyle
d927b6e21a Revert the slash n change 2020-05-23 10:25:01 +01:00
Noel O'Boyle
732444b176 Support Python 2.7. Also Python 3.8. 2020-05-23 10:03:38 +01:00
Geoff Hutchison
1e593abc1e Bump version number for 3.1 release (#2190)
* Bump version number for 3.1 release
2020-05-05 16:43:41 -04:00
Maksim Rakitin
fe72644433 Do not use six 2020-04-06 21:53:11 -04:00
Maksim Rakitin
08b7fc9b59 Fix the import of Tkinter in Python 3+ 2020-04-03 14:03:31 -04:00
Eisuke Kawashima
7bf2ec203f Update scripts/python/setup.py 2019-10-11 16:43:46 +09:00
Eisuke Kawashima
8a8ede202b Update INSTALL and READMEs under scripts/ [ci skip]
- perl
    - assume perl-binding version is different from Open Babel's
- python
    - assume tarball from github release page
    - note: `python scripts/python/setup.py install` does not work since `__init__.py` is missing
2019-10-11 16:06:16 +09:00
Eisuke Kawashima
b657ca216c Fix import of openbabel 2019-10-10 16:54:59 +09:00
Yi-Shu Tu
2a333f90ab typo fix 2019-07-10 11:06:57 +08:00
Yi-Shu Tu
4d312ea42b update the docstring, remove old properties
old properties will raise the error
2019-07-10 10:59:21 +08:00
Yi-Shu Tu
a3700549ad Make pybel compatible with #1975 2019-07-08 15:32:13 +08:00
Noel O'Boyle
532ca37c32 Merge pull request #1970 from e-kwsm/improve-python
Improve python script
2019-04-18 08:26:25 +01:00
Yi-Shu Tu
26f192587f Add __entry__ and __exit__ methods to pybel.Outputfile 2019-04-18 14:13:00 +08:00
Eisuke Kawashima
6b57788a05 Improve python script
- `from __future__ import print_function`
- replace deprecated `unittest.TestCase.assertEquals` with
  `assertEqual`, `assertTrue`, or `assertFalse`
- use `obj is None` instead of `obj == None`
- remove modules and functions that are imported but not used
2019-04-17 21:59:20 +09:00
Matt Swain
5c8165e496 Simplify OB version check in setup.py 2019-03-23 11:22:43 +00:00
Matt Swain
46c9e1f8fd Update setup.py to install into openbabel package 2019-03-21 23:56:54 +00:00
Matt Swain
d05a47ede9 Improved OB version check in setup.py 2019-03-21 23:55:23 +00:00
Matt Swain
0910928392 Simplify pkg-config wrapper in setup.py 2019-03-21 23:53:54 +00:00
Matt Swain
59792513e3 Simplify metadata in setup.py 2019-03-21 23:52:09 +00:00
Matt Swain
bd031bcaa8 Find version from __init__.py to avoid hardcoding in setup.py 2019-03-21 23:50:12 +00:00
Matt Swain
9e29155155 Simplify setup.py long_description 2019-03-21 23:48:16 +00:00
Matt Swain
1d71075f19 Fix setup.py indentation 2019-03-21 23:46:51 +00:00
Noel O'Boyle
978bc4f80e Add the OB version in as a text string to the __init__.py via configure_file 2019-03-07 21:08:02 +00:00
Noel O'Boyle
0c8c4d8d4e Use Matt Swain's __init__.py hack to support 'import openbabel' but mark as deprecated 2019-03-06 15:42:45 +00:00
Noel O'Boyle
0cebc5bc08 Use a relative import so that Python 3 (and 2) are happy 2019-03-05 20:49:50 +00:00
Noel O'Boyle
5f58dd2a90 Update tests 2019-03-04 20:45:27 +00:00
Noel O'Boyle
717b6567cb Add init.py 2019-03-02 20:44:06 +00:00
Noel O'Boyle
13fbcc822b Initial changes 2019-02-27 21:06:04 +00:00
Christoph Hille
56776d15a6 Using pillow instead of PIL
The problem of PIL: the latest version is of 2009 and so there are dependency problems with the new version of numpy and matplotlib
I'm using python2.7 and conda. With pillow there are no dependency problems with the newest numpy and matplotlib versions and "the molecule drawing functianality" works well (y)
2018-04-18 00:02:59 +02:00
Eloy Felix
336abe5694 removed OASA comment. OASA is not used anymore for 2D coordinates generation 2018-02-04 20:48:22 +00:00
Eloy Felix
4baf8a674b add Molecule.make2D function, fixed test 2018-01-24 17:30:14 +00:00
Eloy Felix
06e233e2ca add Molecule.make2D function 2018-01-24 16:49:44 +00:00
Noel O'Boyle
d11d460514 Merge pull request #1673 from Acpharis/pybel_bytes_filename
Use isinstance to test if filename is bytes. Fixes #1615.
2017-10-26 16:37:53 +01:00
David Hall
3194850fc3 use isinstance to test if filename is bytes
Address #1615 by testing if filename is an instance of bytes and use a
bytes suffix in that case. This seems to be the approach used in cpython
source code, so I take it for being pythonic at the moment. (e.g.
https://github.com/python/cpython/blob/3f9183b/Lib/posixpath.py#L119 )
2017-10-24 08:31:28 -04:00
Thomas Heavey
5830d0c2f1 clarified required use of OBMol object
While running the code as given originally would work, the re`import` of openbabel made it seem that the second and third examples would work independently when in fact they won't without defining `mol = openbabel.OBMol()`.
2017-10-06 15:00:39 -04:00
Karol M. Langner
4c3fe03b57 Avoid IndexError for plugins with empty names 2016-12-10 22:03:43 -08:00
Matt Swain
72be31f3fa Python setup.py fixes for 2.4.0 release
This commit contains a few minor changes to the Python setup.py file that is used for independent installation of the Python bindings.

- Version bumped to 2.4.0 to match the main Open Babel version.
- The custom install command sublcass was fixed to just call the superclass install method after the extra build_ext command. This resolved an issue with running bdist_wheel.
- `zip_safe` changed to `False`, so running `python setup.py install` behaviour is more like `pip install openbabel`.
2016-09-23 21:59:16 +01:00
Matt Swain
41337524ba Fix swig include_dirs+library_dirs in setup.py
distutils/setuptools now appear to add some default SWIG `include_dirs` and `library_dirs`, so we should append the openbabel paths to these lists rather than overwriting them entirely.
2015-08-15 18:34:49 +01:00
Geoff Hutchison
98f4465a50 Merge branch 'ipython' of https://github.com/patrickfuller/openbabel into patrickfuller-ipython
Conflicts:
	scripts/python/pybel.py
2015-04-28 14:06:26 -04:00
Geoff Hutchison
b4c645ae4d Merge pull request #140 from mcs07/pythonswig
Remove duplicate swig files
2015-04-19 19:02:26 -04:00
Matt Swain
0c368799f7 Remove duplicate swig files
- Remove the duplicate swig interface files from the `python` directory.
- Remove the rule specifying those files from `MANIFEST.in`.
- Modify `setup.py` to pull in the interface files from the parent directory when preparing the distrubution using `sdist`.
- Add the rule `exclude openbabel.py` to `MANIFEST.in`, to help prevent accidentally including a copy of the resulting swig bindings in the source distribution.
- Bump the python bindings version number to 1.8.2 to allow these changes to be pushed to PyPI.
2015-04-10 14:21:46 +01:00
Patrick Fuller
f070fdde9b Pybel _repr_svg_ cleans up openbabel svg to match IPython requirements 2015-04-06 21:35:47 -05:00
Patrick Fuller
0cc3e4e822 Switched 3d rendering to pip dependency 2015-04-06 20:54:46 -05:00
Geoff Hutchison
81caf8f8fd Fix permissions on scripting interfaces. 2015-02-15 10:41:28 -05:00
Maciek Wójcikowski
08f2b2703d Check for gz in extension and compress output if necessary 2015-02-12 10:12:30 +01:00