Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency on bigfloat package #47

Closed
chazeon opened this issue Jul 6, 2018 · 2 comments
Closed

Dependency on bigfloat package #47

chazeon opened this issue Jul 6, 2018 · 2 comments
Assignees
Labels
dependencies third-party packages/binaries dependencies versioning code/dependencies versioning

Comments

@chazeon
Copy link
Member

chazeon commented Jul 6, 2018

The package bigfloat is the high precision arithmetic used by the Helmholtz free energy part of the calculator to do exponential and logarithm calculation. It is not actively maintained and supports Python 3.5 and 3.6 to date. This outdated package could limit the possibility for our code to be port to Python 3.7 or later versions. As Python 3.7 has its official release, as is mentioned in #46, this could be an issue. So I'm thinking of finding alternatives.

Another package gmpy is more actively developed and maintained, and is marked as a superseder in the Unofficial Windows Binaries for Python Extension Packages page, could be the option.

Yet do we actually need the precision, as is indicated in the code, 500 for our calculator? Just for log and exp? Maybe numpy's float64 is just good enough for the job. Even our unit conversion code could not maintain such high a precision as that.

We should test the outcome of using more convenient ways; and we could maybe give options for drivers and list them as “extra” dependencies for the package, like the Beautiful Soup 4 package does?

@singularitti
Copy link
Member

singularitti commented Jul 7, 2018

Yet do we actually need the precision, as is indicated in the code, 500 for our calculator? Just for log and exp? Maybe numpy's float64 is just good enough for the job. Even our unit conversion code could not maintain such high a precision as that.

Probably we have to use more precision, since we are calculating partition functions, which are usually astronomical figures. You can see the calculated free energies, which are usually large, then a np.exp will make it explode or vanish (for negative energy). float64 is not satisfactory.

@singularitti singularitti changed the title Dependency on bigflaot Dependency on bigfloat package Jul 7, 2018
@singularitti singularitti added dependencies third-party packages/binaries dependencies versioning code/dependencies versioning labels Jul 27, 2018
singularitti added a commit that referenced this issue Jun 16, 2019
@singularitti
Copy link
Member

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies third-party packages/binaries dependencies versioning code/dependencies versioning
Projects
None yet
Development

No branches or pull requests

3 participants