Skip to content

Commit

Permalink
Align directories closer to maven standard
Browse files Browse the repository at this point in the history
:q!
  • Loading branch information
cliffclick committed Feb 13, 2013
1 parent a5789d0 commit 1d43907
Show file tree
Hide file tree
Showing 248 changed files with 96 additions and 115 deletions.
19 changes: 9 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@
*hs_err_pid*
*stdout.txt
*~
/AwsCredentials.properties
TAGS
bin/
build
build.local.conf
dist/
flatfile*
h2o_work.xml
ice
lib/h2o_core.jar
nbbuild.xml
nbproject/
po.*
private/
pytest_flatfile-*
sandbox
dist/
build/
nbproject/
nbbuild.xml
TAGS
build.local.conf
/AwsCredentials.properties
private/
syn_datasets
syn_datasets
target/
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true
# basic build properties
# ------------------------------------------------------------------------------
# This is where the source files (java) are relative to the path of this file
SRC=src
TESTSRC=test-src
SRC=src/main/java
TESTSRC=src/test/java
# and this is where the jar contents is stored relative to this file again
JAR_ROOT=lib

Expand All @@ -32,7 +32,7 @@ JAR_ROOT=lib
DEPENDENCIES="${JAR_ROOT}/jama/*${SEP}${JAR_ROOT}/apache/*${SEP}${JAR_ROOT}/junit/*${SEP}${JAR_ROOT}/gson/*${SEP}${JAR_ROOT}/javassist.jar${SEP}${JAR_ROOT}/poi/*${SEP}${JAR_ROOT}/trove/*${SEP}${JAR_ROOT}/s3/*${SEP}${JAR_ROOT}/jets3t/*"

DEFAULT_HADOOP_VERSION="1.0.0"
OUTDIR="build"
OUTDIR="target"

JAVAC=`which javac`

Expand Down
8 changes: 4 additions & 4 deletions prj.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
(jde-set-variables
'(jde-javadoc-gen-destination-directory "./doc")
'(jde-run-working-directory "$HOME/Desktop/hexbase")
'(jde-run-option-classpath (quote ("./build/classes" "./lib/sigar/sigar.jar" "./lib/hadoop/cdh4/hadoop-common.jar" "./lib/hadoop/cdh4/hadoop-auth.jar" "./lib/hadoop/cdh4/slf4j-api-1.6.1.jar" "./lib/hadoop/cdh4/slf4j-nop-1.6.1.jar" "./lib/hadoop/cdh4/hadoop-hdfs.jar" "./lib/hadoop/cdh4/protobuf-java-2.4.0a.jar" "./lib/apache/commons-codec-1.3.jar" "./lib/apache/commons-configuration-1.6.jar" "./lib/apache/commons-lang-2.4.jar" "./lib/apache/commons-logging-1.1.1.jar" "./lib/apache/commons-logging-api-1.0.4.jar" "./lib/apache/httpclient-4.1.1.jar" "./lib/apache/httpcore-4.1.jar" "./lib/junit/junit-4.11.jar" "./lib/apache/guava-12.0.1.jar" "./lib/gson/gson-2.2.2.jar" "./lib/javassist.jar" "./lib/trove/trove-3.0.3.jar" "./lib/poi/poi-3.8-20120326.jar" "./lib/poi/poi-ooxml-3.8-20120326.jar " "./lib/poi/poi-ooxml-schemas-3.8-20120326.jar" "./lib/poi/dom4j-1.6.1.jar" "./lib/Jama/Jama.jar" "./lib/s3/aws-java-sdk-1.3.27.jar" "./lib/jsr166y")))
'(jde-run-option-classpath (quote ("./target/classes" "./lib/sigar/sigar.jar" "./lib/hadoop/cdh4/hadoop-common.jar" "./lib/hadoop/cdh4/hadoop-auth.jar" "./lib/hadoop/cdh4/slf4j-api-1.6.1.jar" "./lib/hadoop/cdh4/slf4j-nop-1.6.1.jar" "./lib/hadoop/cdh4/hadoop-hdfs.jar" "./lib/hadoop/cdh4/protobuf-java-2.4.0a.jar" "./lib/apache/commons-codec-1.3.jar" "./lib/apache/commons-configuration-1.6.jar" "./lib/apache/commons-lang-2.4.jar" "./lib/apache/commons-logging-1.1.1.jar" "./lib/apache/commons-logging-api-1.0.4.jar" "./lib/apache/httpclient-4.1.1.jar" "./lib/apache/httpcore-4.1.jar" "./lib/junit/junit-4.11.jar" "./lib/apache/guava-12.0.1.jar" "./lib/gson/gson-2.2.2.jar" "./lib/javassist.jar" "./lib/trove/trove-3.0.3.jar" "./lib/poi/poi-3.8-20120326.jar" "./lib/poi/poi-ooxml-3.8-20120326.jar " "./lib/poi/poi-ooxml-schemas-3.8-20120326.jar" "./lib/poi/dom4j-1.6.1.jar" "./lib/Jama/Jama.jar" "./lib/s3/aws-java-sdk-1.3.27.jar" "./lib/jsr166y")))
'(jde-run-option-debug nil)
'(jde-run-option-vm-args nil)
'(jde-compile-option-directory "./build/classes")
'(jde-run-option-application-args (quote ("-mainClass" "embedded.ScoreMain" "org.junit.runner.JUnitCore" "water.score.ScorePmmlTest")))
'(jde-compile-option-directory "./target/classes")
'(jde-run-option-application-args (quote ("-mainClass" "org.junit.runner.JUnitCore" "water.score.ScorePmmlTest")))
'(jde-debugger (quote ("JDEbug")))
'(jde-compile-option-source (quote ("1.6")))
'(jde-compile-option-classpath (quote ("./build/classes" "./lib/sigar/sigar.jar" "./lib/hadoop/1.0.0/hadoop-core-1.0.0.jar" "./lib/apache/commons-codec-1.3.jar" "./lib/apache/commons-configuration-1.6.jar" "./lib/apache/commons-lang-2.4.jar" "./lib/apache/commons-logging-1.1.1.jar" "./lib/apache/commons-logging-api-1.0.4.jar" "./lib/apache/httpclient-4.1.1.jar" "./lib/apache/httpcore-4.1.jar" "./lib/junit/junit-4.11.jar" "./lib/apache/guava-12.0.1.jar" "./lib/gson/gson-2.2.2.jar" "./lib/javassist.jar" "./lib/trove/trove-3.0.3.jar" "./lib/poi/poi-3.8-20120326.jar" "./lib/poi/poi-ooxml-3.8-20120326.jar " "./lib/poi/poi-ooxml-schemas-3.8-20120326.jar" "./lib/jama/Jama.jar" "./lib/s3/aws-java-sdk-1.3.27.jar")))
'(jde-compile-option-classpath (quote ("./target/classes" "./lib/sigar/sigar.jar" "./lib/hadoop/1.0.0/hadoop-core-1.0.0.jar" "./lib/apache/commons-codec-1.3.jar" "./lib/apache/commons-configuration-1.6.jar" "./lib/apache/commons-lang-2.4.jar" "./lib/apache/commons-logging-1.1.1.jar" "./lib/apache/commons-logging-api-1.0.4.jar" "./lib/apache/httpclient-4.1.1.jar" "./lib/apache/httpcore-4.1.jar" "./lib/junit/junit-4.11.jar" "./lib/apache/guava-12.0.1.jar" "./lib/gson/gson-2.2.2.jar" "./lib/javassist.jar" "./lib/trove/trove-3.0.3.jar" "./lib/poi/poi-3.8-20120326.jar" "./lib/poi/poi-ooxml-3.8-20120326.jar " "./lib/poi/poi-ooxml-schemas-3.8-20120326.jar" "./lib/jama/Jama.jar" "./lib/s3/aws-java-sdk-1.3.27.jar")))
'(jde-db-option-classpath (quote ("$HOME/Desktop/Dropbox/Sris and Cliff/H2O/classes")))
'(jde-run-option-enable-assertions "Everywhere")
'(jde-compile-option-sourcepath (quote ("./src")))
Expand Down
10 changes: 5 additions & 5 deletions py/h2o.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,12 @@ def prog(sofar, total):

if not slow_connection:
for h in hosts:
f = find_file('build/h2o.jar')
f = find_file('target/h2o.jar')
h.upload_file(f, progress=prog)
# skipping progress indicator for the flatfile
h.upload_file(flatfile_name())
else:
f = find_file('build/h2o.jar')
f = find_file('target/h2o.jar')
hosts[0].upload_file(f, progress=prog)
hosts[0].push_file_to_remotes(f, hosts[1:])

Expand Down Expand Up @@ -1093,7 +1093,7 @@ def __init__(self, *args, **kwargs):
super(ExternalH2O, self).__init__(*args, **kwargs)

def get_h2o_jar(self):
return find_file('build/h2o.jar') # just a likely guess
return find_file('target/h2o.jar') # just a likely guess

def get_ice_dir(self):
return '/tmp/ice%d' % self.port # just a likely guess
Expand Down Expand Up @@ -1129,7 +1129,7 @@ def __init__(self, *args, **kwargs):
self.ps = spawn[0]

def get_h2o_jar(self):
return find_file('build/h2o.jar')
return find_file('target/h2o.jar')

def get_flatfile(self):
return self.flatfile
Expand Down Expand Up @@ -1257,7 +1257,7 @@ class RemoteH2O(H2O):
def __init__(self, host, *args, **kwargs):
super(RemoteH2O, self).__init__(*args, **kwargs)

self.jar = host.upload_file('build/h2o.jar')
self.jar = host.upload_file('target/h2o.jar')
# need to copy the flatfile. We don't always use it (depends on h2o args)
self.flatfile = host.upload_file(flatfile_name())

Expand Down
34 changes: 17 additions & 17 deletions py/junit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class JUnit(unittest.TestCase):
def testScoring(self):
(ps, stdout, stderr) = h2o.spawn_cmd('junit', [
'java',
'-ea', '-jar', h2o.find_file('build/h2o.jar'),
'-ea', '-jar', h2o.find_file('target/h2o.jar'),
'-mainClass', 'org.junit.runner.JUnitCore',
# The tests
'water.score.ScorePmmlTest',
Expand Down Expand Up @@ -33,22 +33,22 @@ def testAll(self):
'-Dh2o.arg.ice_root='+h2o.tmp_dir('ice.'),
'-Dh2o.arg.name='+h2o.cloud_name(),
'-Dh2o.arg.ip='+h2o.get_ip_address(),
'-ea', '-jar', h2o.find_file('build/h2o.jar'),
'-ea', '-jar', h2o.find_file('target/h2o.jar'),
'-mainClass', 'org.junit.runner.JUnitCore',
# The tests
'test.KVTest',
'test.AppendKeyTest',
'test.RandomForestTest',
'test.AutoSerialTest',
'test.DatasetCornerCasesTest',
'test.ExprTest',
'test.KeyToString',
'test.RStringTest',
'test.ParserTest',
'test.MinorityClassTest',
'test.GLMTest',
'test.RBigDataTest',
'test.KMeansTest'
'hex.GLMTest',
'hex.KMeansTest',
'hex.MinorityClassTest',
'hex.rf.RandomForestTest',
'water.AppendKeyTest',
'water.AutoSerialTest',
'water.KVTest',
'water.KeyToString',
'water.api.RStringTest',
'water.exec.ExprTest',
'water.exec.RBigDataTest',
'water.parser.DatasetCornerCasesTest',
'water.parser.ParserTest'
])

rc = ps.wait(None)
Expand All @@ -67,9 +67,9 @@ def testAll(self):
#def testMore(self):
# (ps, stdout, stderr) = h2o.spawn_cmd('junit', [
# 'java',
# '-ea', '-jar', h2o.find_file('build/h2o.jar'),
# '-ea', '-jar', h2o.find_file('target/h2o.jar'),
# '-mainClass', 'org.junit.runner.JUnitCore',
# 'test.RFRunner',
# 'hex.rf.RFRunner',
# ])
#
# rc = ps.wait(None)
Expand Down
4 changes: 2 additions & 2 deletions py/peta_singletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ def testAll(self):
'-Dh2o.arg.ice_root='+h2o.tmp_dir('ice.'),
'-Dh2o.arg.name=pytest-'+getpass.getuser(),
'-Dh2o.arg.ip='+h2o.get_ip_address(),
'-ea', '-jar', h2o.find_file('build/h2o.jar'),
'-ea', '-jar', h2o.find_file('target/h2o.jar'),
'-mainClass', 'org.junit.runner.JUnitCore',
# The tests
'test.ParserTest',
'water.parser.ParserTest',
])

rc = ps.wait(None)
Expand Down
2 changes: 1 addition & 1 deletion py/run_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# to come up quickly and fight with each other
for h in hosts:
print 'Uploading jar to', h
h.upload_file(h2o.find_file('build/h2o.jar'))
h.upload_file(h2o.find_file('target/h2o.jar'))

nodes = []
for h in hosts:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package hex.rf;

import hex.rf.Tree.StatType;
import hex.rng.H2ORandomRNG.RNGKind;

import java.io.File;
import java.util.*;

import test.RandomForestTest;
import test.TestUtil;
import water.*;
import water.Timer;
import water.util.TestUtil;

/**
* A RandomForest can be used for growing or validation. The former starts with a known target number of trees,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package test;
package hex;

import hex.*;
import hex.GLMSolver.GLMModel;

import java.util.Arrays;

import org.junit.Test;

import water.*;
import water.util.TestUtil;

// Test grid-search over GLM args
public class GLMGridTest extends TestUtil {
Expand Down
15 changes: 7 additions & 8 deletions test-src/test/GLMTest.java → src/test/java/hex/GLMTest.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package test;
package hex;

import static org.junit.Assert.assertEquals;
import com.google.gson.*;
import hex.GLMSolver.GLMModel;
import hex.GLMSolver;
import hex.LSMSolver;
import hex.LinearRegression;
import java.util.Arrays;
import java.util.Map;
import java.util.Random;
import org.junit.*;
import water.*;
import water.api.Constants;
import water.exec.Exec;
import water.exec.PositionedException;
import water.parser.ParseDataset;
import water.api.Constants;
import water.util.TestUtil;

// A series of tests designed to validate GLM's *statistical results* and not,
// i.e. correct behavior when handed bad/broken/null arguments (although those
Expand Down Expand Up @@ -89,7 +88,7 @@ JsonObject computeGLM( GLMSolver.Family family, LSMSolver lsms, ValueArray va, b
try {
// Make some data to test with. 2 columns, all numbers from 0-9
ValueArray va = va_maker(datakey,2,10, new DataExpr() {
double expr( byte[] x ) { return 1.0/(1.0+Math.exp(-(0.1*x[0]+0.3*x[1]-2.5))); } } );
public double expr( byte[] x ) { return 1.0/(1.0+Math.exp(-(0.1*x[0]+0.3*x[1]-2.5))); } } );

LSMSolver lsms = LSMSolver.makeSolver(); // Default normalization of NONE
JsonObject glm = computeGLMlog(lsms,va,false); // Solve it!
Expand All @@ -110,7 +109,7 @@ public static class DataExpr_Dirty extends DataExpr {
final Random _R;
final double _coefs[];
DataExpr_Dirty( Random R, double[] coefs ) { _R = R; _coefs = coefs; }
double expr( byte[] cols ) {
public double expr( byte[] cols ) {
double sum = _coefs[_coefs.length-1]+
(_R.nextDouble()-0.5)/1000.0; // Add some noise
for( int i = 0; i< cols.length; i++ )
Expand Down Expand Up @@ -146,7 +145,7 @@ public static class DataExpr_Dirty extends DataExpr {
try {
// Make some data to test with. 2 columns, all numbers from 0-9
ValueArray va = va_maker(datakey,2,10, new DataExpr() {
double expr( byte[] x ) { return 1.0/(1.0+Math.exp(-(0.1*x[0]+0.3*x[1]-2.5))); } } );
public double expr( byte[] x ) { return 1.0/(1.0+Math.exp(-(0.1*x[0]+0.3*x[1]-2.5))); } } );

// No penalty
LSMSolver lsms0 = LSMSolver.makeSolver();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package test;
package hex;

import hex.KMeans;
import java.util.Arrays;
import java.util.Random;
import org.junit.*;
import water.*;
import water.util.TestUtil;

public class KMeansTest extends TestUtil {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
package test;
package hex;

import static org.junit.Assert.assertTrue;
import hex.rf.MinorityClasses;
import hex.rf.MinorityClasses.UnbalancedClass;

import hex.rf.MinorityClasses;
import java.io.FileInputStream;
import java.util.Arrays;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;

import water.*;
import water.parser.ParseDataset;
import water.util.TestUtil;

public class MinorityClassTest extends TestUtil {
static final int _classIdx = 10;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package test;

import hex.rf.Utils;
package hex.rf;

import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import water.Arguments;
import water.util.TestUtil;

/** Launch RF in a new vm and records results.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package test;
package hex.rf;

import static org.junit.Assert.assertEquals;
import hex.rf.*;
import hex.rf.Tree.StatType;

import org.junit.BeforeClass;

import water.*;
import water.parser.ParseDataset;
import water.util.TestUtil;

public class RandomForestTest extends TestUtil {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package test;
package water;

import java.util.Arrays;
import java.util.Random;

import org.junit.*;

import water.*;
import water.util.TestUtil;

public class AppendKeyTest extends TestUtil {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package test;
package water;

import java.io.*;
import java.util.Arrays;
import org.junit.Assert;
import org.junit.Test;
import water.*;

public class AutoSerialTest extends Iced {
byte _byte, _bytes[];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package test;
package water;

import hex.KMeans;
import java.util.Arrays;
import java.util.Random;
import org.junit.*;
import water.*;
import water.util.TestUtil;

public class ConcurrentKeyTest extends TestUtil {

Expand Down
Loading

0 comments on commit 1d43907

Please sign in to comment.