Skip to content
Snippets Groups Projects
Commit d9d94028 authored by Alessandro Frigeri's avatar Alessandro Frigeri
Browse files

first example in README

parent a4c39bde
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,8 @@ To use moondb module, simply do:: ...@@ -23,6 +23,8 @@ To use moondb module, simply do::
>>> import moondb >>> import moondb
>>> s_12023 = moondb.get_specimens(sc=['12023'])[0] >>> s_12023 = moondb.get_specimens(sc=['12023'])[0]
>>> print( type(s_12023) )
>>> ", ".join( (s_12023.mission,s_12023.landmark,s_12023.specimenType) )
# How to cite MoonDB and python-moondb # How to cite MoonDB and python-moondb
......
MANIFEST.in MANIFEST.in
README.md README.md
setup.py setup.py
examples/Apollo11_soils.py examples/Apollo12_soils.py
examples/example1.ipynb examples/example1.ipynb
examples/specimen.py examples/specimen.py
examples/specimens_weight.py
moondb/__init__.py moondb/__init__.py
moondb/core.py moondb/core.py
moondb/helpers.py moondb/helpers.py
......
No preview for this file type
...@@ -173,8 +173,8 @@ def get_specimens(sc=None,mn=None,ln=None,sty=None,ste=None): ...@@ -173,8 +173,8 @@ def get_specimens(sc=None,mn=None,ln=None,sty=None,ste=None):
sp_list = [] sp_list = []
if sc: if sc:
for s in sc: for s in sc:
count,spec = _get_resp('/specimen/'+s) spec = _get_resp('/specimen/'+s)
sp_list.extend(spec) sp_list.append(spec)
if mn: if mn:
for n in mn: for n in mn:
count,spec = _get_resp('/specimenlist/mission/'+n) count,spec = _get_resp('/specimenlist/mission/'+n)
...@@ -289,7 +289,6 @@ class SpecimenFilter: ...@@ -289,7 +289,6 @@ class SpecimenFilter:
samplingTechnique: list = None samplingTechnique: list = None
def get_results(self): def get_results(self):
#res_list = get_specimens(mn=["Apollo 11"])
res_list = get_specimens(sc=self.specimenCode, res_list = get_specimens(sc=self.specimenCode,
mn=self.missionName, mn=self.missionName,
ln=self.landmarkName, ln=self.landmarkName,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment