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

Code quality fixes #189

Merged
merged 15 commits into from
Oct 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
3.0.0 (upcoming)
3.0.0 (future)
=================

**Breaking Changes**
Expand Down Expand Up @@ -28,7 +28,6 @@ Bug fixes
- Workaround for GNU Assembler bug causing incorrect calculations [#196]



2.3.1 (2019-06-21)
================

Expand Down
2 changes: 1 addition & 1 deletion Corrfunc/mocks/DDrppi_mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def DDrppi_mocks(autocorr, cosmology, nthreads, pimax, binfile,
import numpy as np
from Corrfunc.utils import translate_isa_string_to_enum, fix_ra_dec,\
return_file_with_rbins, convert_to_native_endian,\
is_native_endian, sys_pipes, process_weights
sys_pipes, process_weights
from future.utils import bytes_to_native_str

if not autocorr:
Expand Down
5 changes: 3 additions & 2 deletions Corrfunc/mocks/DDsmu_mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ def DDsmu_mocks(autocorr, cosmology, nthreads, mu_max, nmu_bins, binfile,

import numpy as np
from Corrfunc.utils import translate_isa_string_to_enum, fix_ra_dec,\
return_file_with_rbins, sys_pipes, process_weights, convert_to_native_endian
return_file_with_rbins, convert_to_native_endian,\
sys_pipes, process_weights
from future.utils import bytes_to_native_str

# Check if mu_max is scalar
Expand All @@ -260,7 +261,7 @@ def DDsmu_mocks(autocorr, cosmology, nthreads, mu_max, nmu_bins, binfile,

# Check that mu_max is within (0.0, 1.0]
if mu_max <= 0.0 or mu_max > 1.0:
msg = "The parameter `mu_max` = {0}, is the max. of cosine of an "
msg = "The parameter `mu_max` = {0}, is the max. of cosine of an "\
"angle and should be within (0.0, 1.0]".format(mu_max)
raise ValueError(msg)

Expand Down
2 changes: 1 addition & 1 deletion Corrfunc/mocks/DDtheta_mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def DDtheta_mocks(autocorr, nthreads, binfile,
import numpy as np
from Corrfunc.utils import translate_isa_string_to_enum, fix_ra_dec,\
return_file_with_rbins, convert_to_native_endian,\
is_native_endian, sys_pipes, process_weights
sys_pipes, process_weights
from future.utils import bytes_to_native_str

if autocorr == 0:
Expand Down
3 changes: 1 addition & 2 deletions Corrfunc/mocks/vpf_mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,7 @@ def vpf_mocks(rmax, nbins, nspheres, numpN,
import numpy as np
from future.utils import bytes_to_native_str
from Corrfunc.utils import translate_isa_string_to_enum,\
return_file_with_rbins, convert_to_native_endian,\
is_native_endian, sys_pipes, process_weights
convert_to_native_endian, sys_pipes

# Ensure all input arrays are native endian
RA, DEC, CZ, RAND_RA, RAND_DEC, RAND_CZ = [
Expand Down
5 changes: 3 additions & 2 deletions Corrfunc/theory/DD.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ def DD(autocorr, nthreads, binfile, X1, Y1, Z1, weights1=None, periodic=True,
>>> Y = np.random.uniform(0, boxsize, N)
>>> Z = np.random.uniform(0, boxsize, N)
>>> weights = np.ones_like(X)
>>> results = DD(autocorr, nthreads, binfile, X, Y, Z, weights1=weights, weight_type='pair_product', output_ravg=True)
>>> results = DD(autocorr, nthreads, binfile, X, Y, Z, weights1=weights,
... weight_type='pair_product', output_ravg=True)
>>> for r in results: print("{0:10.6f} {1:10.6f} {2:10.6f} {3:10d} {4:10.6f}".
... format(r['rmin'], r['rmax'], r['ravg'],
... r['npairs'], r['weightavg'])) # doctest: +NORMALIZE_WHITESPACE
Expand Down Expand Up @@ -201,7 +202,7 @@ def DD(autocorr, nthreads, binfile, X1, Y1, Z1, weights1=None, periodic=True,
import numpy as np
from Corrfunc.utils import translate_isa_string_to_enum,\
return_file_with_rbins, convert_to_native_endian,\
is_native_endian, sys_pipes, process_weights
sys_pipes, process_weights
from future.utils import bytes_to_native_str

if not autocorr:
Expand Down
2 changes: 1 addition & 1 deletion Corrfunc/theory/DDrppi.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def DDrppi(autocorr, nthreads, pimax, binfile, X1, Y1, Z1, weights1=None,
import numpy as np
from Corrfunc.utils import translate_isa_string_to_enum,\
return_file_with_rbins, convert_to_native_endian,\
is_native_endian, sys_pipes, process_weights
sys_pipes, process_weights
from future.utils import bytes_to_native_str

if not autocorr:
Expand Down
4 changes: 2 additions & 2 deletions Corrfunc/theory/DDsmu.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def DDsmu(autocorr, nthreads, binfile, mu_max, nmu_bins,
import numpy as np
from Corrfunc.utils import translate_isa_string_to_enum,\
return_file_with_rbins, convert_to_native_endian,\
is_native_endian, sys_pipes, process_weights
sys_pipes, process_weights

from future.utils import bytes_to_native_str

Expand All @@ -267,7 +267,7 @@ def DDsmu(autocorr, nthreads, binfile, mu_max, nmu_bins,

# Check that mu_max is within (0.0, 1.0]
if mu_max <= 0.0 or mu_max > 1.0:
msg = "The parameter `mu_max` = {0}, is the max. of cosine of an "
msg = "The parameter `mu_max` = {0}, is the max. of cosine of an "\
"angle and should be within (0.0, 1.0]".format(mu_max)
raise ValueError(msg)

Expand Down
2 changes: 1 addition & 1 deletion Corrfunc/theory/vpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def vpf(rmax, nbins, nspheres, numpN, seed,
import numpy as np
from future.utils import bytes_to_native_str
from Corrfunc.utils import translate_isa_string_to_enum,\
convert_to_native_endian, is_native_endian, sys_pipes, process_weights
convert_to_native_endian, sys_pipes
from math import pi

if numpN <= 0:
Expand Down
2 changes: 1 addition & 1 deletion Corrfunc/theory/wp.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def wp(boxsize, pimax, nthreads, binfile, X, Y, Z,
from future.utils import bytes_to_native_str
from Corrfunc.utils import translate_isa_string_to_enum,\
return_file_with_rbins, convert_to_native_endian,\
is_native_endian, sys_pipes, process_weights
sys_pipes, process_weights

weights, _ = process_weights(weights, None, X, None, weight_type, autocorr=True)

Expand Down
2 changes: 1 addition & 1 deletion Corrfunc/theory/xi.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def xi(boxsize, nthreads, binfile, X, Y, Z,
from future.utils import bytes_to_native_str
from Corrfunc.utils import translate_isa_string_to_enum,\
return_file_with_rbins, convert_to_native_endian,\
is_native_endian, sys_pipes, process_weights
sys_pipes, process_weights

weights, _ = process_weights(weights, None, X, None, weight_type, autocorr=True)

Expand Down
Loading