-
Notifications
You must be signed in to change notification settings - Fork 76
Fix jupyter logger #1361
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
Fix jupyter logger #1361
Changes from 4 commits
3741d83
1d21d5e
c5b98d5
f56629d
cb93ba6
eea39ee
ea7b9e7
f86b01a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
with(libs.plugins) { | ||
alias(kotlin.jvm) | ||
alias(publisher) | ||
alias(jupyter.api) | ||
alias(ktlint) | ||
alias(dataframe) | ||
alias(ksp) | ||
} | ||
} | ||
|
||
group = "org.jetbrains.kotlinx" | ||
|
||
repositories { | ||
// geo repository should come before Maven Central | ||
maven("https://repo.osgeo.org/repository/release") | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
|
||
// https://stackoverflow.com/questions/26993105/i-get-an-error-downloading-javax-media-jai-core1-1-3-from-maven-central | ||
// jai core dependency should be excluded from geotools dependencies and added separately | ||
fun ExternalModuleDependency.excludeJaiCore() = exclude("javax.media", "jai_core") | ||
|
||
dependencies { | ||
implementation(projects.dataframeGeo) | ||
implementation(projects.dataframeJupyter) | ||
|
||
implementation(libs.geotools.referencing) { excludeJaiCore() } | ||
|
||
// logger, need it for geotools | ||
implementation(libs.log4j.core) | ||
implementation(libs.log4j.api) | ||
|
||
testImplementation(kotlin("test")) | ||
} | ||
|
||
tasks.withType<KotlinCompile>().configureEach { | ||
friendPaths.from(project(projects.core.path).projectDir) | ||
} | ||
|
||
kotlinPublications { | ||
publication { | ||
publicationName = "dataframeGeoJupyter" | ||
artifactId = project.name | ||
description = "GeoDataFrame API" | ||
packageName = artifactId | ||
} | ||
} | ||
|
||
tasks.processJupyterApiResources { | ||
libraryProducers = listOf("org.jetbrains.kotlinx.dataframe.jupyter.IntegrationGeo") | ||
} | ||
|
||
tasks.test { | ||
useJUnitPlatform() | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,11 @@ internal class IntegrationGeo : JupyterIntegration() { | |
useSchema<WithMultiLineStringGeometry>() | ||
} | ||
|
||
render<GeoDataFrame<*>> { | ||
println("GeoDataFrame with ${it.crs} CRS and inner dataframe:") | ||
it.df | ||
} | ||
|
||
val replCodeGeneratorImpl = ReplCodeGeneratorImpl() | ||
replCodeGeneratorImpl.process(WithGeometry::class) | ||
replCodeGeneratorImpl.process(WithPolygonGeometry::class) | ||
|
@@ -67,7 +72,7 @@ internal class IntegrationGeo : JupyterIntegration() { | |
val generatedDf = execute( | ||
codeWithTypeCastGenerator = replCodeGeneratorImpl.process(geo.df, kProperty), | ||
expression = "(${kProperty.name}.df as DataFrame<*>)", | ||
) | ||
).let { "`" + it.toString() + "`" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
But what does this do? It renders the DF as string and adds crs? Isn't it better to output the DF natively and output CRS as string? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice :) Is it always static, though? or is that just your screenshot? |
||
val name = execute("GeoDataFrame($generatedDf, ${kProperty.name}.crs)").name | ||
name | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## This file must *NOT* be checked into Version Control Systems, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to remove this file :D |
||
# as it contains information specific to your local configuration. | ||
# | ||
# Location of the SDK. This is only used by Gradle. | ||
# For customization when using a Version Control System, please read the | ||
# header note. | ||
#Fri Aug 01 16:02:03 AMT 2025 | ||
sdk.dir=/Users/andrei.kislitsyn/Library/Android/sdk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering, should this be a separate module? I think it can just be part of the dataframe-jupyter module, potentially with the
useExperimentalGeo
flagThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dataframe-geo is really heavy and I wouldn't like it to be a part of general
dataframe
artifact, neither%use dataframe
in notebooks. So I'd really like to keep them separate