MDAnalysis / mdanalysis

MDAnalysis is a Python library to analyze molecular dynamics simulations.
https://mdanalysis.org
Other
1.33k stars 653 forks source link

replace fasteners #4797

Open orbeckst opened 1 week ago

orbeckst commented 1 week ago

The fasteners package is licensed under the Apache 2.0 license, which is incompatible with our target license LGPLv2.1+. We therefore need to replace it with a compatible alternative.

Reason

Further background on why this change is necessary: https://www.mdanalysis.org/2023/09/22/licensing-update/#why-the-interim-gpl-v3-and-lgpl-v3-package-licenses-the-issue-with-apache-20

Alternatives to fasteners

One possibility is py-filelock but others could be explored, too.

Background

orbeckst commented 1 week ago

When someone is looking at the XDR offsets code, please scrutinize the line https://github.com/MDAnalysis/mdanalysis/blob/c48962e1b95cd04c2e79d348be6c530b33e40ebd/package/MDAnalysis/coordinates/XDR.py#L202-L204 Is it possible that this ought to be

self._read_offsets(store=False) 

because we just determined that we cannot write to the location? This may save a warning from _read_offsets. However, I only briefly glanced at the code and because this is all subtle, I don't want to jump to conclusions. Just look at it carefully.

talagayev commented 1 week ago

I would tackle this one if it is fine :)

py-filelock does work from local testing, as for alternatives I looked portalocker looks also as an option, but would need more code refactoring, so I would tend towards py-filelock, other than that didn't find any good alternatives.

orbeckst commented 1 week ago

Put up a PR! Thanks!

yuxuanzhuang commented 1 week ago

When someone is looking at the XDR offsets code, please scrutinize the line

https://github.com/MDAnalysis/mdanalysis/blob/c48962e1b95cd04c2e79d348be6c530b33e40ebd/package/MDAnalysis/coordinates/XDR.py#L202-L204

Is it possible that this ought to be

self._read_offsets(store=False) 

because we just determined that we cannot write to the location? This may save a warning from _read_offsets. However, I only briefly glanced at the code and because this is all subtle, I don't want to jump to conclusions. Just look at it carefully.

Yes. I think self._read_offsets(store=False) makes much more sense and is not breaking anything here.