Skip to content

Commit

Permalink
Merge pull request #67 from scidash/code-climate
Browse files Browse the repository at this point in the history
Code climate
  • Loading branch information
rgerkin committed Feb 12, 2018
2 parents 3591f59 + 97014f7 commit 0de9a2e
Show file tree
Hide file tree
Showing 35 changed files with 2,525 additions and 2,218 deletions.
36 changes: 31 additions & 5 deletions docs/chapter2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
{
"data": {
"text/plain": [
"<sciunit.scores.BooleanScore at 0x109a3e4e0>"
"<sciunit.scores.complete.BooleanScore at 0x10bf58a20>"
]
},
"execution_count": 10,
Expand Down Expand Up @@ -364,7 +364,7 @@
"equals_1_test = EqualsTest(1, name='=1') # Test that model output equals 1. \n",
"equals_2_test = EqualsTest(2, name='=2') # Test that model output equals 2. \n",
"\n",
"equals_suite = sciunit.TestSuite(\"Equals test suite\", [equals_1_test, equals_2_test, equals_37_test])"
"equals_suite = sciunit.TestSuite([equals_1_test, equals_2_test, equals_37_test], name=\"Equals test suite\")"
]
},
{
Expand Down Expand Up @@ -462,7 +462,20 @@
"data": {
"text/html": [
"<html><body><div>\n",
"<table border=\"1\" class=\"dataframe\" id=\"-6951170927268633672\">\n",
"<style scoped=\"\">\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\" id=\"913968671956531036\">\n",
"<thead>\n",
"<tr style=\"text-align: right;\">\n",
"<th></th>\n",
Expand Down Expand Up @@ -739,7 +752,20 @@
"data": {
"text/html": [
"<html><body><div>\n",
"<table border=\"1\" class=\"dataframe\" id=\"-2432389546818237383\">\n",
"<style scoped=\"\">\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\" id=\"-2295631968650733791\">\n",
"<thead>\n",
"<tr style=\"text-align: right;\">\n",
"<th></th>\n",
Expand Down Expand Up @@ -899,5 +925,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 2
}
17 changes: 4 additions & 13 deletions docs/chapter3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"source": [
"from sciunit.capabilities import ProducesNumber\n",
"from sciunit.scores import ZScore # One of many SciUnit score types. \n",
"from sciunit import ObservationError # An exception class raised when a test is instantiated \n",
"from sciunit.errors import ObservationError # An exception class raised when a test is instantiated \n",
" # with an invalid observation.\n",
" \n",
"class MeanTest(sciunit.Test):\n",
Expand All @@ -86,9 +86,9 @@
" \n",
" def validate_observation(self, observation):\n",
" if type(observation) is not dict:\n",
" raise sciunit.ObservationError(\"Observation must be a python dictionary\")\n",
" raise ObservationError(\"Observation must be a python dictionary\")\n",
" if 'mean' not in observation:\n",
" raise sciunit.ObservationError(\"Observation must contain a 'mean' entry\")\n",
" raise ObservationError(\"Observation must contain a 'mean' entry\")\n",
" \n",
" def generate_prediction(self, model):\n",
" return model.produce_number() # The model has this method if it inherits from the 'ProducesNumber' capability.\n",
Expand Down Expand Up @@ -214,15 +214,6 @@
"source": [
"score.describe()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -245,5 +236,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 2
}

0 comments on commit 0de9a2e

Please sign in to comment.