Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.8.9 #377

Merged
merged 14 commits into from
Jun 3, 2024
12 changes: 8 additions & 4 deletions commons/passive/google/google_places_info.avsc
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@
"type": "enum",
"doc": "The predefined categories or tags assigned to different places based on their characteristics. These types can represent various categories such as restaurants, cafes, museums, parks, hotels, airports, hospitals, and more.",
"symbols": [ "ACCOUNTING", "ADMINISTRATIVE_AREA_LEVEL_1", "ADMINISTRATIVE_AREA_LEVEL_2", "ADMINISTRATIVE_AREA_LEVEL_3", "ADMINISTRATIVE_AREA_LEVEL_4", "ADMINISTRATIVE_AREA_LEVEL_5", "AIRPORT", "AMUSEMENT_PARK", "AQUARIUM", "ARCHIPELAGO", "ART_GALLERY", "ATM", "BAKERY", "BANK", "BAR", "BEAUTY_SALON", "BICYCLE_STORE", "BOOK_STORE", "BOWLING_ALLEY", "BUS_STATION", "CAFE", "CAMPGROUND", "CAR_DEALER", "CAR_RENTAL", "CAR_REPAIR", "CAR_WASH", "CASINO", "CEMETERY", "CHURCH", "CITY_HALL", "CLOTHING_STORE", "COLLOQUIAL_AREA", "CONTINENT", "CONVENIENCE_STORE", "COUNTRY", "COURTHOUSE", "DENTIST", "DEPARTMENT_STORE", "DOCTOR", "DRUGSTORE", "ELECTRICIAN", "ELECTRONICS_STORE", "EMBASSY", "ESTABLISHMENT", "FINANCE", "FIRE_STATION", "FLOOR", "FLORIST", "FOOD", "FUNERAL_HOME", "FURNITURE_STORE", "GAS_STATION", "GENERAL_CONTRACTOR", "GEOCODE", "GROCERY_OR_SUPERMARKET", "GYM", "HAIR_CARE", "HARDWARE_STORE", "HEALTH", "HINDU_TEMPLE", "HOME_GOODS_STORE", "HOSPITAL", "INSURANCE_AGENCY", "INTERSECTION", "JEWELRY_STORE", "LAUNDRY", "LAWYER", "LIBRARY", "LIGHT_RAIL_STATION", "LIQUOR_STORE", "LOCAL_GOVERNMENT_OFFICE", "LOCALITY", "LOCKSMITH", "LODGING", "MEAL_DELIVERY", "MEAL_TAKEAWAY", "MOSQUE", "MOVIE_RENTAL", "MOVIE_THEATER", "MOVING_COMPANY", "MUSEUM", "NATURAL_FEATURE", "NEIGHBORHOOD", "NIGHT_CLUB", "PAINTER", "PARK", "PARKING", "PET_STORE", "PHARMACY", "PHYSIOTHERAPIST", "PLACE_OF_WORSHIP", "PLUMBER", "PLUS_CODE", "POINT_OF_INTEREST", "POLICE", "POLITICAL", "POST_BOX", "POST_OFFICE", "POSTAL_CODE_PREFIX", "POSTAL_CODE_SUFFIX", "POSTAL_CODE", "POSTAL_TOWN", "PREMISE", "PRIMARY_SCHOOL", "REAL_ESTATE_AGENCY", "RESTAURANT", "ROOFING_CONTRACTOR", "ROOM", "ROUTE", "RV_PARK", "SCHOOL", "SECONDARY_SCHOOL", "SHOE_STORE", "SHOPPING_MALL", "SPA", "STADIUM", "STORAGE", "STORE", "STREET_ADDRESS", "STREET_NUMBER", "SUBLOCALITY_LEVEL_1", "SUBLOCALITY_LEVEL_2", "SUBLOCALITY_LEVEL_3", "SUBLOCALITY_LEVEL_4", "SUBLOCALITY_LEVEL_5", "SUBLOCALITY", "SUBPREMISE", "SUBWAY_STATION", "SUPERMARKET", "SYNAGOGUE", "TAXI_STAND", "TOURIST_ATTRACTION", "TOWN_SQUARE", "TRAIN_STATION", "TRANSIT_STATION", "TRAVEL_AGENCY", "UNIVERSITY", "VETERINARY_CARE", "ZOO"]
}], "doc": "Categorizing places based on their characteristics or attributes, this field represents the first type, if any, among the retrieved place categories.", "default": null
}], "doc": "Categorizing places based on their characteristics or attributes, This field is deprecated, as the Google Place.Type enum is deprecated. Instead, use the placeType field of string type.", "default": null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is deprecated, do we still need to keep this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, can't we just do the enum conversion on our side or is it not a fixed set of values anymore?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is deprecated, do we still need to keep this?

As per Yatharth's comment, we cannot delete existing fields in Avro schemas. Therefore, I have kept the field without removing it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay I see, sorry I missed that. What about creating a new version?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is for backwards compatibility and in line with the schema evolution guidelines. We can probably create a new version but not necessary IMO.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay I see, yes, might be overkill. Thanks!

},
{ "name": "type2", "type": ["null", "org.radarcns.passive.google.PlacesType"], "doc": "Categorizing places based on their characteristics or attributes, this field represents the second type, if any, among the retrieved place categories.", "default": null },
{ "name": "type3", "type": ["null", "org.radarcns.passive.google.PlacesType"], "doc": "Categorizing places based on their characteristics or attributes, this field represents the third type, if any, among the retrieved place categories.", "default": null },
{ "name": "type4", "type": ["null", "org.radarcns.passive.google.PlacesType"], "doc": "Categorizing places based on their characteristics or attributes, this field represents the fourth type, if any, among the retrieved place categories.", "default": null },
{ "name": "type2", "type": ["null", "org.radarcns.passive.google.PlacesType"], "doc": "Categorizing places based on their characteristics or attributes, This field is deprecated, as the Google Place.Type enum is deprecated. Instead, use the placeType field of string type.", "default": null },
{ "name": "type3", "type": ["null", "org.radarcns.passive.google.PlacesType"], "doc": "Categorizing places based on their characteristics or attributes, This field is deprecated, as the Google Place.Type enum is deprecated. Instead, use the placeType field of string type.", "default": null },
{ "name": "type4", "type": ["null", "org.radarcns.passive.google.PlacesType"], "doc": "Categorizing places based on their characteristics or attributes, This field is deprecated, as the Google Place.Type enum is deprecated. Instead, use the placeType field of string type.", "default": null },
{ "name": "placeType1", "type": ["null", "string"], "doc": "Categorizing places based on their characteristics or attributes, this field represents the first type, if any, among the retrieved place categories.", "default": null },
Copy link
Member

@mpgxvii mpgxvii Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make the type an array of strings so we don't have to specify the place type number? Or do we not want nested types?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially, this was an array, but Joris suggested not to use it due to performance overhead. This is the link for that review.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay I see. Thanks for the clarification!

{ "name": "placeType2", "type": ["null", "string"], "doc": "Categorizing places based on their characteristics or attributes, this field represents the second type, if any, among the retrieved place categories.", "default": null },
{ "name": "placeType3", "type": ["null", "string"], "doc": "Categorizing places based on their characteristics or attributes, this field represents the third type, if any, among the retrieved place categories.", "default": null },
{ "name": "placeType4", "type": ["null", "string"], "doc": "Categorizing places based on their characteristics or attributes, this field represents the fourth type, if any, among the retrieved place categories.", "default": null },
{ "name": "city", "type": ["null", "string"], "doc": "The city returned corresponds to the current location of the user's device.", "default": null },
{ "name": "state", "type": ["null", "string"], "doc": "The state returned corresponds to the current location of the user's device.", "default": null },
{ "name": "country", "type": ["null", "string"], "doc": "The country returned corresponds to the current location of the user's device.", "default": null },
Expand Down
13 changes: 13 additions & 0 deletions commons/passive/ticwatch/ticwatch_acceleration.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"namespace": "org.radarcns.passive.ticwatch",
"type": "record",
"name": "TicwatchAcceleration",
"doc": "Data from 3-axis accelerometer sensor of a Mobovi TicWatch device.",
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (ms)." },
{ "name": "timeReceived", "type": "double", "doc": "Processed time since the Unix Epoch (seconds)." },
{ "name": "x", "type": "float", "doc": "Acceleration in the x-axis (g)." },
{ "name": "y", "type": "float", "doc": "Acceleration in the y-axis (g)." },
{ "name": "z", "type": "float", "doc": "Acceleration in the z-axis (g)." }
]
}
11 changes: 11 additions & 0 deletions commons/passive/ticwatch/ticwatch_battery_level.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"namespace": "org.radarcns.passive.ticwatch",
"type": "record",
"name": "TicwatchBatteryLevel",
"doc": "Battery level of a TicWatch device.",
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (ms)." },
{ "name": "timeReceived", "type": "double", "doc": "Processed time since the Unix Epoch (seconds)." },
{ "name": "batteryLevel", "type": "float", "doc": "Battery level from 0 to 1. Note that the battery level is a rough estimate." }
]
}
13 changes: 13 additions & 0 deletions commons/passive/ticwatch/ticwatch_gyroscope.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"namespace": "org.radarcns.passive.ticwatch",
"type": "record",
"name": "TicwatchGyroscope",
"doc": "Data from 3-axis gyroscope sensor of a Mobovi TicWatch device.",
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (ms)." },
{ "name": "timeReceived", "type": "double", "doc": "Processed time since the Unix Epoch (seconds)." },
{ "name": "x", "type": "float", "doc": "Angular velocity in the x-axis (rad/s)." },
{ "name": "y", "type": "float", "doc": "Angular velocity in the y-axis (rad/s)." },
{ "name": "z", "type": "float", "doc": "Angular velocity in the z-axis (rad/s)." }
]
}
12 changes: 12 additions & 0 deletions commons/passive/ticwatch/ticwatch_ppg.avsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"namespace": "org.radarcns.passive.ticwatch",
"type": "record",
"name": "TicwatchPpg",
"doc": "PPG collected using a Mobovi TicWatch.",
"fields": [
{ "name": "time", "type": "double", "doc": "Device timestamp in UTC (ms)." },
{ "name": "timeReceived", "type": "double", "doc": "Processed time since the Unix Epoch (seconds)." },
{ "name": "redled", "type": "float", "doc": "Red LED." },
{ "name": "iredled", "type": "float", "doc": "Infrared LED." }
]
}
2 changes: 1 addition & 1 deletion java-sdk/buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
object Versions {
const val project = "0.8.8"
const val project = "0.8.9"

const val kotlin = "1.9.10"
const val java = 17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package org.radarbase.schema.registration
import io.ktor.client.plugins.auth.Auth
import io.ktor.client.plugins.auth.providers.BasicAuthCredentials
import io.ktor.client.plugins.auth.providers.basic
import io.ktor.client.request.basicAuth
import io.ktor.client.request.setBody
import io.ktor.client.request.url
import io.ktor.http.ContentType
Expand Down Expand Up @@ -56,8 +57,8 @@ import kotlin.time.toKotlinDuration
*/
class SchemaRegistry(
private val baseUrl: String,
apiKey: String? = null,
apiSecret: String? = null,
private val apiKey: String? = null,
private val apiSecret: String? = null,
private val topicConfiguration: Map<String, TopicConfig> = emptyMap(),
) {
private val schemaClient: SchemaRetriever = schemaRetriever(baseUrl) {
Expand All @@ -66,6 +67,7 @@ class SchemaRegistry(
if (apiKey != null && apiSecret != null) {
install(Auth) {
basic {
sendWithoutRequest { true }
credentials {
BasicAuthCredentials(username = apiKey, password = apiSecret)
}
Expand Down Expand Up @@ -93,6 +95,9 @@ class SchemaRegistry(
try {
httpClient.request<List<String>> {
url("subjects")
if (apiKey != null && apiSecret != null) {
basicAuth(apiKey, apiSecret)
}
}
} catch (ex: RestException) {
logger.error(
Expand Down Expand Up @@ -175,6 +180,7 @@ class SchemaRegistry(
val record: SpecificRecord = AvroTopic.parseSpecificRecord(topicValueSchema)
record.javaClass to record.schema
}

defaultTopic != null -> defaultTopic.valueClass to defaultTopic.valueSchema
else -> {
logger.warn(
Expand Down
47 changes: 47 additions & 0 deletions specifications/passive/ticwatch-1.0.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#====================================== TicWatch device =====================================#
vendor: Mobobi
model: TicWatch
version: 1.0.0
app_provider: .ticwatch.TicwatchSeviceProvier
data:
- type: ACCELEROMETER
sample_rate:
dynamic: true
unit: G
processing_state: RAW
topic: android_esl_ticwatch_acceleration
value_schema: .passive.ticwatch.TicwatchAcceleration
- type: GYROSCOPE
sample_rate:
dynamic: true
unit: RADAIAN_PER_SEC
processing_state: RAW
topic: android_esl_ticwatch_gyroscope
value_schema: .passive.ticwatch.TicwatchGyroscope
- type: BATTERY
sample_rate:
dynamic: true
unit: PERCENTAGE
processing_state: RAW
topic: android_esl_ticwatch_battery_level
value_schema: .passive.ticwatch.TicwatchBatteryLevel
- type: PPG
sample_rate:
dynamic: true
unit: UNKNOWN
processing_state: RAW
topic: android_esl_ticwatch_ppg
value_schema: .passive.ticwatch.TicwatchPpg
- type: EXTERNAL_TIME
doc: Information sent by the Mobovi Ticwatch about time synchronisation with a NTP server.
sample_rate:
dynamic: true
unit: SECOND
topic: application_external_time
value_schema: .monitor.application.ApplicationExternalTime
- type: DEVICE_INFO
doc: Device information where the app is installed.
sample_rate:
dynamic: true
topic: application_device_info
value_schema: .monitor.application.ApplicationDeviceInfo
Loading