openbabel:adalke_writestring

Last commit made on 2020-04-13
Get this branch:
git clone -b adalke_writestring https://git.launchpad.net/openbabel

Branch merges

Branch information

Name:
adalke_writestring
Repository:
lp:openbabel

Recent commits

f84e724... by baoilleach

Apply patch from @fredrikw to fix test failure. Also minor changes as recommended by codacity code review.

7d0e7a6... by baoilleach

Comment out pointcloud test. Uses a random-number generator. (Note to anyone reading this: please avoid random number generators at all costs.)

90d2d8d... by baoilleach

Update the SVG test. Also ensure that double-quotes are used in (recent changes to) the SVG writer to be consistent with the rest.

fdb3e90... by baoilleach

Update test for changes to PDB default CONECT records multiple bonds

4fc4e5d... by baoilleach

Update the Gaussian format tests

03eefec... by baoilleach

Fix at least some tests on Windows

29347a7... by Andrew Dalke

added test/testobconv_writers.py to the list of Python tests

282d7f6... by Andrew Dalke

Improved patch for #1922 to support the Write() API for multiple records.

My first patch set Index=1 in WriteFile() and WriteString() so that
the output format plugin could perform any initialization. This worked,
but there was still a problem with some formats when saving multiple
records, including the CML format.

The CML format uses <molecule> as the top-level element when there is
only one input molecule, and <cml> as the top-level element when there
are two or more molecules. The <cml> element contains a sequence of
<molecule> elements.

If Index==1 and IsLast()==true then it's a single-molecule file.
If Index==1 and IsLast()==false then it's a multi-molecule file.

However, OBConversion::Write() always called SetOneObjectOnly(),
which set Last=true, so the CML format always thought it was writing
a single-record output file.

The fix was to remove SetOneObjectOnly() from the Write() and
do more intialization in WriteFile() and WriteString(). Previously
Write() did Index++ *after* calling the format's WriteMolecule().
This was incorrect. It needs to be done *before*, so the value
of GetOutputIndex() matches the number of molecules which were
sent as output. (This is a better emulation of how Convert() works.)

This in turn means WriteFile() and WriteString() need to reset
Index to 0. They then call Write(), which increments Index, so
WriteMolecule() always sees Index=1 for the first molecule.

e5bc6c0... by Andrew Dalke

OBConversion::WriteString() and WriteFile() must reset the Index to 1 otherwise the formats won't initialize correctly. (Issue #1922)

This commit includes a new test program which checks WriteString() and WriteFile() for most of the supported formats.

Without this patch, several of them will fail, and the FPS format will segfault.

8d6a59b... by Geoff Hutchison <email address hidden>

Initial CMake GitHub Action (#2165)

* Initial CMake GitHub Action

Thanks to Cristian Adam for a template (and blog article)
https://cristianadam.eu/20191222/using-github-actions-with-c-plus-plus-and-cmake/
https://raw.githubusercontent.com/cristianadam/HelloWorld/master/.github/workflows/build_cmake.yml

Cleaned up also with tips from Edward Thomson:
https://www.edwardthomson.com/blog/github_actions_14_conditionals_with_a_matrix.html