What Does A Passing Events Dataset Look Like?#
Note: This next step assumes you have done all the steps in the below code
Code for occurrences and events for example dataset
>>> # this is each individual step as a command
>>> import pandas as pd
>>> import galaxias
>>>
>>> # first, events
>>> my_dwca=galaxias.dwca(occurrences="galaxias_user_guide/data/occurrences_event_nomulti.csv",
... events="galaxias_user_guide/data/events_use.csv")
>>> my_dwca.set_events(eventType='type',
... samplingProtocol='Observation',
... Event='name',
... event_hierarchy={1: "Site Visit", 2: "Sample", 3: "Observation"})
>>> my_dwca.occurrences['Latitude'] = pd.to_numeric(my_dwca.occurrences['Latitude'],errors='coerce')
>>> my_dwca.occurrences['Longitude'] = pd.to_numeric(my_dwca.occurrences['Longitude'],errors='coerce')
>>> my_dwca.set_datetime(check_events=True,eventDate='date',string_to_datetime=True,yearfirst=False,dayfirst=True)
>>> my_dwca.set_occurrences(basisOfRecord='HumanObservation',
... occurrenceID=True)
>>> my_dwca.set_scientific_name(scientificName='Species')
>>> my_dwca.set_coordinates(decimalLatitude='Latitude',
... decimalLongitude='Longitude',
... geodeticDatum='WGS84',
... coordinatePrecision=0.1)
>>> my_dwca.set_datetime(eventDate='Collection_date',
... string_to_datetime=True,
... yearfirst=False,
... dayfirst=True)
>>> my_dwca.set_occurrences(add_eventID=True,eventType='Observation')
>>> my_dwca.set_abundance(individualCount='number_birds')
>>> my_dwca.set_locality(check_events = True, locality='location')
>>> my_dwca.check_dataset()
Before you write your metadata using delma
or package your Darwin Core Archive using galaxias
,
run check_data()
for the final time.
>> galaxias.check_data()
If everything passes, you will get the following output:
Traceback (most recent call last):
File "/Users/buy003/Documents/GitHub/galaxias-python/docs/source/galaxias_user_guide/longitudinal_studies/events_workflow.py", line 145, in <module>
my_dwca.set_events(eventType='type',
File "/Users/buy003/anaconda3/envs/galaxias-dev/lib/python3.11/site-packages/galaxias/dwca_build.py", line 633, in set_events
self.events = corella.set_events(dataframe=self.events,eventID=eventID,parentEventID=parentEventID,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/buy003/anaconda3/envs/galaxias-dev/lib/python3.11/site-packages/corella/set_events.py", line 117, in set_events
dataframe=generate_eventID_parentEventID(dataframe=dataframe,event_hierarchy=event_hierarchy,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/buy003/anaconda3/envs/galaxias-dev/lib/python3.11/site-packages/corella/generate_eventID_parentEventID.py", line 36, in generate_eventID_parentEventID
new_dataframe = add_unique_IDs(dataframe=new_dataframe,column_name='eventID',
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/buy003/anaconda3/envs/galaxias-dev/lib/python3.11/site-packages/corella/add_unique_IDs.py", line 110, in add_unique_IDs
raise ValueError("Please specify whether or not you want a random ID, sequential ID or composite ID.")
ValueError: Please specify whether or not you want a random ID, sequential ID or composite ID.