Empact-hierclust 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{Empact-hierclust}
8
- s.version = "0.2.2"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Brandt Kurowski", "Ben Woosley"]
12
- s.date = %q{2010-11-02}
12
+ s.date = %q{2010-11-05}
13
13
  s.description = %q{performs hierarchical clustering on points in Euclidian space}
14
14
  s.email = %q{ben.woosley@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -1,3 +1,11 @@
1
+ == 0.3.0 2010-11-05
2
+
3
+ * 1 api change
4
+ * Clusterer.cluster takes a hash of options, rather than positional arguments for resolution & separation
5
+ * 2 minor enhancements
6
+ * Pass the :nils option to Cluster.cluster to provide a stand-in for nil values
7
+ * Allow Clusterer.cluster to apply resolution without separation
8
+
1
9
  == 0.2.2 2010-11-01
2
10
 
3
11
  * 1 minor enhancement
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.3.0
@@ -51,9 +51,8 @@ module Hierclust
51
51
  end
52
52
 
53
53
  def precluster(points)
54
- unless @resolution && @separation
54
+ unless @resolution
55
55
  # preclustering is only applicable given lower bound on resolution
56
- # can't precluster w/ no min separation given
57
56
  return points.dup
58
57
  end
59
58
  if @separation == 0
@@ -61,7 +60,7 @@ module Hierclust
61
60
  return [Cluster.new(points)]
62
61
  end
63
62
  points.inject({}) do |grid_clusters, point|
64
- grid_coordinates = point.coordinates.map {|coord| (coord / @resolution).floor }
63
+ grid_coordinates = point.coordinates.map {|coord| ((coord || @nils) / @resolution).floor }
65
64
  grid_clusters[grid_coordinates] ||= Cluster.new([])
66
65
  grid_clusters[grid_coordinates] << point
67
66
  grid_clusters
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
9
- - 2
10
- version: 0.2.2
8
+ - 3
9
+ - 0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brandt Kurowski
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-11-02 00:00:00 -07:00
19
+ date: 2010-11-05 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency