Skip to content

Commit

Permalink
Changed package name to sensingcluespy (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphdewit committed May 30, 2024
1 parent 44679d3 commit d3436de
Show file tree
Hide file tree
Showing 20 changed files with 29 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
project = "sensingcluespy"
copyright = "2024, SensingClues"
author = "SensingClues"
release = "0.2.2"
release = "0.2.3"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
17 changes: 10 additions & 7 deletions notebooks/sensingclues_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.16.2
# format_version: '1.4'
# jupytext_version: 1.2.0
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
Expand All @@ -15,16 +15,17 @@
# # Extract wildlife observation data with SensingClues
#
# [SensingClues](https://sensingclues.org/) allows you to record, monitor and analyze wildlife observations to support nature conservation initiatives. This notebook shows the following:
#
# - **Basic**: the main SensingClues-functionality of **extracting observation and track data**.
# - **Advanced**: this section includes the usage of a hierarchy of available concepts (e.g. animal species or type of activity), which enhances reporting and analysis of the observation data. Further, we show how to collect and visualize layer data from SensingClues.
#
# You can adapt this notebook to extract your own recordings. For more detail on what you can configure as a user, see the API-documentation of the `sensingclues`-package.
# You can adapt this notebook to extract your own recordings. For more detail on what you can configure as a user, see the API-documentation of the `sensingcluespy`-package.
#
# ### Before you start
#
# To run this notebook, you should:
# - create a personal account at SensingClues using the Cluey Data Collector app, which can be downloaded from the Google Playstore (not supported for iOS currently). Also see [here](https://sensingclues.org/portal).
# - install the `sensingclues`-package in a virtual python environment (`pip install -e .` from the main directory of the repository).
# - install the `sensingcluespy`-package in a virtual python environment (`pip install -e .` from the main directory of the repository).
# - install the requirements in requirements.txt (if not already installed automatically in the previous step).
# - create a file '.env' in the root of the wildcat-api-python-repository, containing your SensingClues credentials. These will be read in this notebook to log in. The file should look like this:
# ```
Expand All @@ -39,9 +40,9 @@

from dotenv import load_dotenv

from sensingclues import sclogging
from sensingclues.api_calls import SensingClues
from sensingclues.src import helper_functions as helpers
from sensingcluespy import sclogging
from sensingcluespy.api_calls import SensingClues
from sensingcluespy.src import helper_functions as helpers

logger = sclogging.get_sc_logger()
sclogging.set_sc_log_level("DEBUG")
Expand Down Expand Up @@ -191,6 +192,7 @@
# - Further, if you want to exclude subconcepts, i.e. keep observations with the label 'animal' but exclude observations with the label 'elephant', set `include_subconcepts=False`.
#

# +
concept_animal = [
"https://sensingclues.poolparty.biz/SCCSSOntology/308", # Impala
"https://sensingclues.poolparty.biz/SCCSSOntology/319", # Giraffe
Expand All @@ -204,6 +206,7 @@
concepts=concept_animal,
coord={"north": 32, "east": 20, "south": 31.5, "west": 10}
)
# -

observations.head()

Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "sensingclues"
name = "sensingcluespy"
authors = [
{name = "sensing_clues", email = "[email protected]"},
]
version = "0.2.2"
version = "0.2.3"
description = "Python client to extract data from SensingClues"
readme = "readme.md"
requires-python = ">=3.9"
Expand All @@ -31,7 +31,7 @@ optional-dependencies.dev = { file = ["requirements_dev.txt"] }
sensingclues = ["extractors/*"]

[tool.setuptools.packages.find]
include = ["sensingclues*"]
include = ["sensingcluespy*"]
exclude = ["docs/*", "tests/*", "notebooks/*"]

[tool.black]
Expand All @@ -48,7 +48,7 @@ extend-exclude = '''
profile = "black"

[tool.bumpver]
current_version = "0.2.2"
current_version = "0.2.3"
version_pattern = "MAJOR.MINOR.PATCH[-TAG]"
commit_message = "bump version {old_version} -> {new_version}"
tag_message = "{new_version}"
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions sensingclues/api_calls.py → sensingcluespy/api_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import pandas as pd
import requests

from sensingclues import sclogging
from sensingclues.src import DataExtractor, align_extractor, make_query
from sensingclues.src.exceptions import (
from sensingcluespy import sclogging
from sensingcluespy.src import DataExtractor, align_extractor, make_query
from sensingcluespy.src.exceptions import (
SCClientNotFoundError, SCPermissionDenied, SCServiceUnavailable,
)

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.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pkg_resources

data_path = pkg_resources.resource_filename("sensingclues", "extractors/")
data_path = pkg_resources.resource_filename("sensingcluespy", "extractors/")


def flatten_list(nested_list: list) -> list:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"""Extracts specific elements from the SensingClues data.
The elements to extract are specified in local JSON files,
located in ``/sensingclues/extractors/``."""
located in ``/sensingcluespy/extractors/``."""

import json
from typing import List, Union

import pkg_resources

from sensingclues.src.data_cleaner import flatten_list
from sensingclues.src.helper_functions import recursive_get_from_dict
from sensingcluespy.src.data_cleaner import flatten_list
from sensingcluespy.src.helper_functions import recursive_get_from_dict

data_path = pkg_resources.resource_filename("sensingclues", "extractors/")
data_path = pkg_resources.resource_filename("sensingcluespy", "extractors/")

DEFAULT_EXTRACTION_TYPES = [
"extract_values",
Expand All @@ -22,7 +22,7 @@ class DataExtractor(object):
"""Extract specific elements from raw data returned by calls to Focus.
The elements to extract are specified in local JSON files, located in
/sensingclues/extractors/. Usage of these extractor-jsons
/sensingcluespy/extractors/. Usage of these extractor-jsons
makes it easier to add your own method to the API and extract specific
elements, without modifying this DataExtractor-class.
Expand All @@ -34,7 +34,7 @@ class DataExtractor(object):
def __init__(self, extractor_name: str):
"""Read and process extractor configuration
Extractor configurations should be located in sensingclues/extractors/.
Extractor configurations should be located in sensingcluespy/extractors/.
:param extractor_name: Name of extractor configuration to use.
"""
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
# from unittest.mock import Mock, patch
#
#
# from sensingclues import api_calls
# from sensingclues.api_calls import SensingClues
# from sensingcluespy import api_calls
# from sensingcluespy.api_calls import SensingClues
# from dotenv import load_dotenv


# @patch('sensingclues.api_calls.SensingClues.login')
# @patch('sensingcluespy.api_calls.SensingClues.login')
# def test_login(mock_get):
# # Configure the mock to return a response with an OK status code.
# mock_get.response.status_code = 200
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pytest

from sensingclues.src import flatten_list, get_list_values, select_columns
from sensingcluespy.src import flatten_list, get_list_values, select_columns


@pytest.mark.data_cleaner
Expand Down

0 comments on commit d3436de

Please sign in to comment.