lib/numru/gphys/assoccoords.rb in gphys-1.5.3 vs lib/numru/gphys/assoccoords.rb in gphys-1.5.4
- old
+ new
@@ -17,22 +17,25 @@
# < argument check >
if assoc_crds.uniq.length != assoc_crds.length
raise ArgumentError, "Names are not uniq: #{assoc_crds.inspect}."
end
+ @axnames = axnames.dup
assoc_crds.each do |gp|
raise(ArgumentError,"Non-GPhys included") if !gp.is_a?(GPhys)
if axnames.include?(gp.name)
raise ArgumentError,
"'#{gp.name}' overwraps an axis name #{axnames.inspect}."
end
+ if (gp.axnames - @axnames).length > 0
+ raise ArgumentError, "Provided assoc coord '#{gp.name}' has an axis (axes) #{gp.axnames - @axnames} not in the present object #{@axnames}"
+ end
end
# < some internal variables >
@assoc_crds = Hash.new
assoc_crds.each{|gp| @assoc_crds[gp.name] = gp}
- @axnames = axnames.dup
@lost_assoc_crds = nil
# < lengths of original axes >
@axlens = Hash.new