Closed godotgildor closed 1 year ago
Thanks for the contribution! Good to hear you found DNA Chisel useful. What is the purpose of your tool / is it public by any chance?
The mentioned extra dependencies are not required for the package, we use it only for testing & development. They're installed during CI: https://github.com/Edinburgh-Genome-Foundry/DnaChisel/blob/58321ce018318935ee28f448b2c051d4b00f370e/.travis.yml#L7
If you wish to include them, please create a requirements-dev.txt
file in root and list them there instead.
I'll try and have a look at the rest sometime but could you please provide context for your feature requirement; also just to confirm >=
does not work?
My bad for __geq__
. Regarding test dependencies, another way could be to add a tests
section to the extra_requires
here so you can do pip install dnachisel[tests]
. But a requirements-dev.txt
also works.
My bad for
__geq__
. Regarding test dependencies, another way could be to add atests
section to theextra_requires
here so you can dopip install dnachisel[tests]
. But arequirements-dev.txt
also works.
I went ahead and made a tests
extra that includes all of the packages installed in the travis ci currently. I also updated the travis CI config to use this extras install.
@Zulko - just wanted to check back-in about this PR - anything else I can provide or changes you'd like to see?
I'm merging this today or tomorrow together with the other 2 PRs
Unfortunately the tests fail for EnforceRegionsCompatibility
because Location
became unhashable due to the changes. Location.__hash__
attribute is now set to None
. This means the Counter function doesn't work on a list of Locations:
Suggestions are welcome. Perhaps a solution is to implement a simple counter, for example https://stackoverflow.com/questions/45955740/counting-occurrences-without-using-collections-counter
https://github.com/Edinburgh-Genome-Foundry/DnaChisel/actions/runs/5164168843/jobs/9302899033
I just updated the PR with a commit which adds in a __hash__
method for Location
and corresponding tests.
I think this should address the issue with the Counter
.
Can you take a look?
Thank you, that was helpful. Tests pass, so I'll make a release by tomorrow after merging the other PR.
I was writing some unit tests for a tool I wrote which uses DnaChisel. I wanted to assert equality between some Location objects, but found that currently Location only supports
<
and it looks like it tries to support>=
.This PR does the following:
__eq__
method to theLocation
class so that we can test for equality now.__geq__
method - I believe the correct syntax would have been__ge__
. However we don't need this method now because I also:total_ordering
decorator to the definition of theLocation
class. This decorator will automatically create all comparison operators as long as the class has a definition of__eq__
and one other comparison - in this case we also have__lt__
==
,>=
and<
comparisons all work.