embray / gappy

Python interface to GAP
GNU General Public License v3.0
13 stars 5 forks source link

Make it possible to set Gap.gap_root before initialization #8

Open embray opened 3 years ago

embray commented 3 years ago

Currently the only way to change initialization options like gap_root as well as others is to create a new Gap instance like Gap(gap_root=...), and same for other options.

However, it should be possible to assign to the .gap_root property, as well as others such as .workspace on the default Gap instance, as long as the GAP interpreter hasn't been initialized yet. E.g.,

>>> from gappy import gap
>>> gap.gap_root = '/path/to/gap/root'
>>> gap.eval('1 + 1')  # gets initialized here

This might be a simpler alternative to #5, and do away with exposing the possibility of creating new Gap instances altogether (at least, until and unless it is possible to have multiple GAP interpreters in a single process).