Skip to content

Commit

Permalink
fix egs in occurrences.get and related methods in docstrings
Browse files Browse the repository at this point in the history
and in demos jupyter notebook
fix #39
  • Loading branch information
sckott committed Oct 19, 2016
1 parent f5f14f6 commit 0c9a7ac
Show file tree
Hide file tree
Showing 32 changed files with 253 additions and 188 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@

# pycharm project info
.idea/

# ipython notebook files
.ipynb_checkpoints
*/.ipynb_checkpoints/*
12 changes: 11 additions & 1 deletion Changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Changelog
=========

0.2.0 (2016-10-18)
--------------------
- Download methods much improved (#16) (#27) thanks @jlegind @stijnvanhoey @peterdesmet !
- MULTIPOLYGON now supported in `geometry` parameter (#35)
- xxx (#xx)
- xxx (#xx)
- xxx (#xx)
- xxx (#xx)
- xxx (#xx)

0.1.5.4 (2016-10-01)
--------------------
- Added many new `occurrence.search` parameters, including `repatriated`, `kingdomKey`, `phylumKey`, `classKey`, `orderKey`, `familyKey`, `genusKey`, `subgenusKey`, `establishmentMeans`, `facet`, `facetMincount`, `facetMultiselect`, and support for facet paging via `**kwargs` (#30) (#34)
Expand All @@ -13,7 +23,7 @@ Changelog
- Changed default `limit` value to 300 for `occurrences.search` method
- `tox` now included, via @xrotwang (#20)
- Added more registry methods (#11)
- Started occurrence download methods (#16
- Started occurrence download methods (#16)
- Added more names methods (#18)
- All requests now send user-agent headers with `requests` and `pygbif` versions (#13)
- Bug fix for `occurrences.download_get` (#23)
Expand Down
182 changes: 100 additions & 82 deletions demos/pygbif-intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,66 +17,59 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"{u'colCoveragePct': 79,\n",
" u'colMatchingCount': 24335,\n",
"{u'colCoveragePct': 76,\n",
" u'colMatchingCount': 22483,\n",
" u'countByConstituent': {},\n",
" u'countByIssue': {u'BACKBONE_MATCH_FUZZY': 573,\n",
" u'BACKBONE_MATCH_NONE': 1306,\n",
" u'VERNACULAR_NAME_INVALID': 7777},\n",
" u'countByKingdom': {u'ANIMALIA': 30,\n",
" u'FUNGI': 3,\n",
" u'INCERTAE_SEDIS': 26,\n",
" u'PLANTAE': 10997,\n",
" u'PROTOZOA': 1},\n",
" u'countByOrigin': {u'DENORMED_CLASSIFICATION': 2010,\n",
" u'PROPARTE': 11,\n",
" u'SOURCE': 28775},\n",
" u'countByIssue': {u'BACKBONE_MATCH_NONE': 1338,\n",
" u'VERNACULAR_NAME_INVALID': 7852},\n",
" u'countByKingdom': {u'PLANTAE': 8949},\n",
" u'countByOrigin': {u'PROPARTE': 10, u'SOURCE': 29260},\n",
" u'countByRank': {u'CLASS': 1,\n",
" u'FAMILY': 172,\n",
" u'GENUS': 3255,\n",
" u'GENUS': 1251,\n",
" u'ORDER': 55,\n",
" u'SECTION': 323,\n",
" u'SECTION': 326,\n",
" u'SERIES': 40,\n",
" u'SPECIES': 6046,\n",
" u'SPECIES': 6071,\n",
" u'SUBCLASS': 6,\n",
" u'SUBFAMILY': 150,\n",
" u'SUBGENUS': 99,\n",
" u'SUBGENUS': 101,\n",
" u'SUBSECTION': 56,\n",
" u'SUBSPECIES': 742,\n",
" u'SUBSPECIES': 737,\n",
" u'SUBTRIBE': 61,\n",
" u'SUPERORDER': 12,\n",
" u'TRIBE': 328,\n",
" u'VARIETY': 863},\n",
" u'countExtRecordsByExtension': {u'DESCRIPTION': 10176,\n",
" u'DISTRIBUTION': 29037,\n",
" u'VARIETY': 871},\n",
" u'countExtRecordsByExtension': {u'DESCRIPTION': 10213,\n",
" u'DISTRIBUTION': 29143,\n",
" u'IDENTIFIER': 0,\n",
" u'MULTIMEDIA': 0,\n",
" u'REFERENCE': 0,\n",
" u'SPECIES_PROFILE': 0,\n",
" u'TYPES_AND_SPECIMEN': 0,\n",
" u'VERNACULAR_NAME': 32143},\n",
" u'countNamesByLanguage': {u'ENGLISH': 20864, u'FRENCH': 11279},\n",
" u'created': u'2015-08-19T16:44:57.166+0000',\n",
" u'VERNACULAR_NAME': 32290},\n",
" u'countNamesByLanguage': {u'ENGLISH': 20989, u'FRENCH': 11301},\n",
" u'created': u'2016-07-27T20:34:07.015+0000',\n",
" u'datasetKey': u'3f8a1297-3259-4700-91fc-acc4170b27ce',\n",
" u'distinctNamesCount': 30776,\n",
" u'downloaded': u'2015-08-19T16:04:50.099+0000',\n",
" u'key': 1481,\n",
" u'distinctNamesCount': 29254,\n",
" u'downloaded': u'2016-07-27T20:34:07.013+0000',\n",
" u'key': 55067,\n",
" u'nubCoveragePct': 95,\n",
" u'nubMatchingCount': 29490,\n",
" u'nubMatchingCount': 27932,\n",
" u'otherCount': {},\n",
" u'synonymsCount': 18587,\n",
" u'usagesCount': 30796}"
" u'synonymsCount': 19032,\n",
" u'usagesCount': 29270}"
]
},
"execution_count": 6,
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -95,7 +88,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 2,
"metadata": {
"collapsed": false
},
Expand All @@ -121,8 +114,11 @@
" u'phylum': u'Chordata',\n",
" u'phylumKey': 44,\n",
" u'rank': u'SPECIES',\n",
" u'scientificName': u'Puma concolor (Linnaeus, 1771)',\n",
" u'species': u'Puma concolor',\n",
" u'speciesKey': 2435099}],\n",
" u'speciesKey': 2435099,\n",
" u'status': u'ACCEPTED',\n",
" u'synonym': False}],\n",
" 'hierarchy': [{u'1': u'Animalia',\n",
" u'2435098': u'Puma',\n",
" u'359': u'Mammalia',\n",
Expand All @@ -131,7 +127,7 @@
" u'9703': u'Felidae'}]}"
]
},
"execution_count": 5,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -157,7 +153,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 3,
"metadata": {
"collapsed": false
},
Expand All @@ -177,7 +173,7 @@
" u'Basidiomycota']"
]
},
"execution_count": 7,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -197,55 +193,88 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"{u'basisOfRecord': u'OBSERVATION',\n",
" u'catalogNumber': u'70875196',\n",
" u'collectionCode': u'7472',\n",
" u'continent': u'EUROPE',\n",
" u'country': u'United Kingdom',\n",
" u'countryCode': u'GB',\n",
" u'datasetKey': u'26a49731-9457-45b2-9105-1b96063deb26',\n",
" u'day': 30,\n",
" u'decimalLatitude': 52.51021,\n",
" u'decimalLongitude': -1.0193,\n",
" u'eventDate': u'2006-06-29T22:00:00.000+0000',\n",
"{u'basisOfRecord': u'PRESERVED_SPECIMEN',\n",
" u'bibliographicCitation': u'http://www.tropicos.org/Specimen/100889255',\n",
" u'catalogNumber': u'100889255',\n",
" u'class': u'Magnoliopsida',\n",
" u'classKey': 220,\n",
" u'collectionCode': u'MO',\n",
" u'collectionID': u'http://biocol.org/urn:lsid:biocol.org:col:15859',\n",
" u'continent': u'NORTH_AMERICA',\n",
" u'country': u'Panama',\n",
" u'countryCode': u'PA',\n",
" u'county': u'La Pintada',\n",
" u'crawlId': 18,\n",
" u'datasetKey': u'7bd65a7a-f762-11e1-a439-00145eb45e9a',\n",
" u'datasetName': u'Tropicos',\n",
" u'day': 11,\n",
" u'decimalLatitude': 8.68,\n",
" u'decimalLongitude': -80.60056,\n",
" u'elevation': 753.0,\n",
" u'eventDate': u'2016-01-11T00:00:00.000+0000',\n",
" u'extensions': {},\n",
" u'facts': [],\n",
" u'gbifID': u'252408386',\n",
" u'family': u'Juglandaceae',\n",
" u'familyKey': 2499,\n",
" u'fieldNumber': u'9',\n",
" u'gbifID': u'1258202889',\n",
" u'genericName': u'Alfaroa',\n",
" u'genus': u'Alfaroa',\n",
" u'genusKey': 7310533,\n",
" u'geodeticDatum': u'WGS84',\n",
" u'identifiedBy': u'DA Lott',\n",
" u'identifier': u'urn:catalog:MO:Tropicos:100889255',\n",
" u'identifiers': [],\n",
" u'institutionCode': u'Leicestershire and Rutland Environmental Records Centre',\n",
" u'issues': [u'COORDINATE_ROUNDED',\n",
" u'GEODETIC_DATUM_ASSUMED_WGS84',\n",
" u'TAXON_MATCH_NONE'],\n",
" u'key': 252408386,\n",
" u'lastCrawled': u'2013-09-07T07:08:17.000+0000',\n",
" u'lastInterpreted': u'2014-06-05T03:33:35.082+0000',\n",
" u'locality': u'Saddington Reservoir, Saddington Reservoir',\n",
" u'month': 6,\n",
" u'individualCount': 3,\n",
" u'institutionCode': u'MO',\n",
" u'issues': [u'COORDINATE_ROUNDED', u'GEODETIC_DATUM_ASSUMED_WGS84'],\n",
" u'key': 1258202889,\n",
" u'kingdom': u'Plantae',\n",
" u'kingdomKey': 6,\n",
" u'lastCrawled': u'2016-06-06T11:13:54.020+0000',\n",
" u'lastInterpreted': u'2016-08-04T03:07:30.466+0000',\n",
" u'lastParsed': u'2016-03-21T14:33:34.346+0000',\n",
" u'license': u'http://creativecommons.org/licenses/by/4.0/legalcode',\n",
" u'locality': u'Corregimiento del Harino. Parque Nacional General de Divisi\\xf3n Omar Torrijos Herrera (PNGDOTH) el Cop\\xe9, camino hacia La Rica, aproximadamente a 1.5 Km. al NO de la caba\\xf1a de visitantes del parque. Parcela Los corazones 1 (PP-Corazones-1).',\n",
" u'month': 1,\n",
" u'nomenclaturalCode': u'ICNafp',\n",
" u'nomenclaturalStatus': u'No opinion',\n",
" u'occurrenceID': u'urn:catalog:MO:Tropicos:100889255',\n",
" u'order': u'Fagales',\n",
" u'orderKey': 1354,\n",
" u'ownerInstitutionCode': u'MOBOT',\n",
" u'phylum': u'Tracheophyta',\n",
" u'phylumKey': 7707728,\n",
" u'protocol': u'DWC_ARCHIVE',\n",
" u'publishingCountry': u'GB',\n",
" u'publishingOrgKey': u'07f617d0-c688-11d8-bf62-b8a03c50a862',\n",
" u'recordedBy': u'DA Lott',\n",
" u'publishingCountry': u'US',\n",
" u'publishingOrgKey': u'90fd6680-349f-11d8-aa2d-b8a03c50a862',\n",
" u'recordNumber': u'Flores Jim\\xe9nez 3724',\n",
" u'recordedBy': u'Rodolfo Flores|M. Madrid|Y. Pe\\xf1a|L. De Gracia V.|R. Berenguer|J. Rodr\\xedguez|J. Vargas|A. Gonzalez C.|C. L\\xf3pez V.|R. Vergara E.|H. Moreno',\n",
" u'relations': [],\n",
" u'year': 2006}"
" u'rightsHolder': u'Missouri Botanical Garden',\n",
" u'scientificName': u'Alfaroa Standl.',\n",
" u'stateProvince': u'Cocl\\xe9',\n",
" u'taxonID': u'40009683',\n",
" u'taxonKey': 7310533,\n",
" u'taxonRank': u'GENUS',\n",
" u'type': u'PhysicalObject',\n",
" u'year': 2016}"
]
},
"execution_count": 9,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"occurrences.get(key = 252408386)"
"occurrences.get(key = 1258202889)"
]
},
{
Expand All @@ -257,36 +286,25 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"500283031"
"546341356"
]
},
"execution_count": 10,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"occurrences.count(isGeoreferenced = True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
""
]
}
],
"metadata": {
Expand All @@ -298,7 +316,7 @@
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
Expand All @@ -310,4 +328,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
Binary file modified docs/_build/doctrees/changelog_link.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/occurrences.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/species.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: b90a377759b3467f2798c54589bc46ad
config: 2a689e895ead89eed271b97632cf41a7
tags: 645f666f9bcd5a90fca523b33c5a78b7
8 changes: 4 additions & 4 deletions docs/_build/html/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Overview: module code &mdash; pygbif 0.1.5.4 documentation</title>
<title>Overview: module code &mdash; pygbif 0.1.6.0 documentation</title>



Expand All @@ -30,7 +30,7 @@



<link rel="top" title="pygbif 0.1.5.4 documentation" href="../index.html"/>
<link rel="top" title="pygbif 0.1.6.0 documentation" href="../index.html"/>


<script src="../_static/js/modernizr.min.js"></script>
Expand Down Expand Up @@ -58,7 +58,7 @@


<div class="version">
0.1.5.4
0.1.6.0
</div>


Expand Down Expand Up @@ -170,7 +170,7 @@ <h1>All modules for which code is available</h1>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'0.1.5.4',
VERSION:'0.1.6.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
Expand Down

0 comments on commit 0c9a7ac

Please sign in to comment.