-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Visualize Maven parent POM artifactIds & versions in use (#24)
- Loading branch information
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "ef753160-169b-452a-9c8c-9e0940820f9e", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from code_data_science import data_table as dt\n", | ||
"\n", | ||
"df = dt.read_csv(\"../samples/maven_parent_poms.csv\")\n", | ||
"df.head()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "86cc5354-5bf9-4682-999b-62e91ea05d1b", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"data = df.drop(columns=[\"repositoryOrigin\", \"repositoryPath\", \"repositoryBranch\", \"projectName\", \"groupId\", \"datedSnapshotVersion\", \"relativePath\"])\n", | ||
"data" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "2a0d241e-8523-4e45-a3f7-33c13bda9927", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"versions = (\n", | ||
" data.groupby([\"artifactId\", \"version\"], as_index=False)\n", | ||
" .value_counts()\n", | ||
" .pivot(index=\"artifactId\", columns=\"version\")\n", | ||
" .fillna(0)\n", | ||
")\n", | ||
"versions" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "94a5f63e-670e-4321-94fe-d3a57770b4c5", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import code_data_science.palette as palette\n", | ||
"import matplotlib.pyplot as plt\n", | ||
"\n", | ||
"colors = palette.qualitative()\n", | ||
"\n", | ||
"ax = versions.plot.bar(stacked=True, colormap=plt.cm.colors.ListedColormap(colors))\n" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
type: specs.moderne.io/v1beta/visualization | ||
name: io.moderne.MavenParentPOMs | ||
displayName: Maven parent POMs | ||
description: This report shows the different Maven parent POMs that are used in the projects. | ||
recipe: org.openrewrite.maven.search.ParentPomInsight | ||
dataTable: org.openrewrite.maven.table.ParentPomsInUse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
repositoryOrigin,repositoryPath,repositoryBranch,projectName,groupId,artifactId,version,datedSnapshotVersion,relativePath | ||
github.com,spring-projects/spring-petclinic,main,spring-petclinic,org.springframework.boot,"spring-boot-starter-parent",3.1.3,, | ||
github.com,spring-cloud/spring-cloud-kubernetes,main,spring-cloud-kubernetes,org.springframework.cloud,"spring-cloud-build",4.0.5,, |