Closed JBGreisman closed 3 years ago
To do:
rs
codebaseMerging #94 (9fb3a52) into main (dfdae4e) will increase coverage by
0.09%
. The diff coverage is99.03%
.
@@ Coverage Diff @@
## main #94 +/- ##
==========================================
+ Coverage 98.87% 98.97% +0.09%
==========================================
Files 40 41 +1
Lines 1512 1561 +49
==========================================
+ Hits 1495 1545 +50
+ Misses 17 16 -1
Flag | Coverage Δ | |
---|---|---|
unittests | 98.97% <99.03%> (+0.09%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
reciprocalspaceship/decorators.py | 98.61% <98.61%> (ø) |
|
reciprocalspaceship/dataset.py | 99.01% <100.00%> (+0.17%) |
:arrow_up: |
reciprocalspaceship/utils/asu.py | 100.00% <100.00%> (ø) |
|
reciprocalspaceship/utils/cell.py | 100.00% <100.00%> (ø) |
|
reciprocalspaceship/utils/phases.py | 100.00% <100.00%> (ø) |
|
reciprocalspaceship/utils/stats.py | 100.00% <100.00%> (ø) |
|
reciprocalspaceship/utils/structurefactors.py | 100.00% <100.00%> (+2.00%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update dfdae4e...9fb3a52. Read the comment docs.
Fixes #92.
It is common in
rs
to write functions that takegemmi.SpaceGroup
orgemmi.UnitCell
instances as arguments. In order to make these methods more flexible, it is often useful to add error checking code so that if anint
is provided instead of agemmi.SpaceGroup
, the method generates the equivalentgemmi
object instance. This was done for theDataSet.cell
andDataSet.spacegroup
setter methods to address #18.This PR generalizes this idea using
@spacegroupify
and@cellify
decorators to avoid needing to write boiler plate argument checking code. This allows one to write a function as if it is guaranteed that the input argument is agemmi
object, while still being able to input that argument flexibly. For example: