Skip to content

Commit

Permalink
Merge pull request #37 from libmir/upgradedeps
Browse files Browse the repository at this point in the history
upgrade dependencies
  • Loading branch information
ShigekiKarita committed Oct 26, 2018
2 parents f015d5b + a296e61 commit 7c9e10e
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ before_install:
fi

script:
- dub test --arch "$ARCH" --build=unittest-cov
- dub test --arch "$ARCH" --build=unittest-python-cov
# FIXME libcurl not found in 32bit
- if [ $ARCH = "x86_64" ]; then
wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz;
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ test_script:
- echo %PATH%
- '%DC% --version'
- cd test && python test_npy_fileio.py && cd ..
- dub test --arch=%Darch% --build=unittest-cov
- dub test --arch=%Darch% --build=unittest-python-cov
29 changes: 13 additions & 16 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
],
"description": "numpy-like API wrappers of mir",
"dependencies": {
"mir-algorithm": "~>2.0.1",
"mir-random": "~>1.0.0"
"mir-random": "~>2.0.0"
},
"copyright": "Copyright © 2017, karita",
"license": "BSL-1.0",
Expand All @@ -18,25 +17,23 @@
"--unittest-examples"
],
"buildTypes": {
"unittest": {
"unittest-python": {
"buildOptions": ["unittests", "debugMode", "debugInfo"],
"versions": ["mir_test"],
"preBuildCommands": ["cd test && python test_npy_fileio.py || true ; cd .."]
},
"unittest-cov": {
"unittest-python-cov": {
"buildOptions": ["unittests", "coverage", "debugMode", "debugInfo"],
"versions": ["mir_test"],
"preBuildCommands": ["cd test && python test_npy_fileio.py || true ; cd .."]
}
}
},
"configurations": [
{
"name": "library",
"targetType": "library"
},
{
"name": "sourceLibrary",
"targetType": "sourceLibrary"
}
],
{
"name": "library",
"targetType": "library"
},
{
"name": "sourceLibrary",
"targetType": "sourceLibrary"
}
]
}
4 changes: 2 additions & 2 deletions source/numir/core/creation.d
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ auto ones(E = double, size_t N)(size_t[N] lengths...) pure
///
unittest
{
import mir.ndslice.algorithm : all;
import mir.algorithm.iteration : all;

// -------
// | 1 1 1 |
Expand Down Expand Up @@ -177,7 +177,7 @@ auto zeros(E = double, size_t N)(size_t[N] lengths...) pure
///
unittest
{
import mir.ndslice.algorithm : all;
import mir.algorithm.iteration : all;

// -------
// | 0 0 0 |
Expand Down
2 changes: 1 addition & 1 deletion source/numir/core/manipulation.d
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ TODO:
+/
auto resize(S)(S s, size_t size) pure if (isSlice!S)
out(ret) {
import mir.ndslice.algorithm : all;
import mir.algorithm.iteration : all;
assert(ret.length == size);
if (s.length < size) assert(ret[s.length .. $].all!"a == 0");
} do {
Expand Down
2 changes: 1 addition & 1 deletion source/numir/core/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ unittest
*/

import mir.ndslice.slice : sliced, DeepElementType;
import mir.ndslice.algorithm : all;
import mir.algorithm.iteration : all;

// np.empty, empty_like
assert(empty(2 ,3).shape == [2, 3]);
Expand Down
11 changes: 2 additions & 9 deletions source/numir/random.d
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module numir.random;

import std.algorithm : fold;
import mir.random : unpredictableSeed, Random;
import mir.random.algorithm : range;
import mir.random.variable : UniformVariable, NormalVariable;
import mir.ndslice: slicedField, slice;

Expand All @@ -29,13 +28,6 @@ class RNG
return *_rng;
}

///
static auto field(V)(V var)
{
import mir.random.algorithm : field;
return field(this.get, var);
}

///
static void setSeed(uint seed)
{
Expand Down Expand Up @@ -65,7 +57,8 @@ unittest
/// general function for random slice generation with global RNG
auto generate(V, size_t N)(V var, size_t[N] length...)
{
return RNG.field(var).slicedField(length);
import mir.random.algorithm: randomSlice;
return RNG.get.randomSlice(var, length);
}

///
Expand Down
9 changes: 5 additions & 4 deletions source/numir/stats.d
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pure nothrow @safe
unittest
{
import numir.core : alongDim;
import mir.ndslice : map, sliced, byDim, iota, slice;
import mir.ndslice : map, byDim, iota, slice, sliced;

// sorted cases
assert(iota(5).median == 2);
Expand Down Expand Up @@ -285,7 +285,7 @@ unittest

//Set sum algorithm or output type
static immutable a = [1, 1e100, 1, -1e100];
auto x = a.sliced.map!"a * 10_000";
auto x = a.sliced * 10_000;
assert(x.mean!"kbn" == 20_000 / 4);
assert(x.mean!"kb2" == 20_000 / 4);
assert(x.mean!"precise" == 20_000 / 4);
Expand Down Expand Up @@ -576,7 +576,7 @@ unittest

//Set sum algorithm or output type
static immutable _x = [1, 1e100, 1, -1e100];
auto x = _x.sliced.map!"a * 10_000";
auto x = _x.sliced * 10_000;
assert(approxEqual(x.hmean!"kbn", 20_000));
assert(approxEqual(x.hmean!"kb2", 20_000));
assert(approxEqual(x.hmean!"precise", 20_000));
Expand Down Expand Up @@ -1197,7 +1197,8 @@ unittest
{
// logsumexp example from doctest https://github.com/scipy/scipy/blob/maintenance/1.0.x/scipy/special/_logsumexp.py
import mir.ndslice : iota, map, sliced, as;
import mir.math : sum, log, exp;
import mir.math.common : log, exp;
import mir.math.sum;
import std.math : approxEqual;
{
auto x = iota(10).as!double;
Expand Down

0 comments on commit 7c9e10e

Please sign in to comment.