Skip to content

Commit

Permalink
Replace Datapane with ITables
Browse files Browse the repository at this point in the history
Datapane is no longer maintained and doesn’t support Pandas v2. Plus ITables looks better
  • Loading branch information
rafmudaf committed Jan 17, 2025
1 parent f7cab23 commit e914f40
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
37 changes: 16 additions & 21 deletions docs/portfolio_analysis/attribute_table.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,18 @@ kernelspec:
The sections here tabulate the software attribute database.
Each attribute (column) is described in the [](schema).
Some columns contain lists of strings which means that they cannot be fully sorted.
Instead, they can be filtered by searching for a string with the following Sequel query:

```sql
SELECT * FROM $table WHERE <column name> LIKE '%<search string>%';

-- For example:
SELECT * FROM $table WHERE system_location LIKE '%land%';
```
Instead, they can be filtered by searching for a string in the search box

```{code-cell} ipython3
:tags: [hide-cell]
from pathlib import Path
import yaml
import datapane as dp
from itables import init_notebook_mode
import pandas as pd
init_notebook_mode(all_interactive=True)
software_attr_dir = Path("..", "..", "software_attributes")
model_list_inputs = yaml.safe_load( open(software_attr_dir / "database_list.yaml", "r") )
models = model_list_inputs["active"]
Expand Down Expand Up @@ -71,7 +66,7 @@ general_df = df[[
"data_collection_methods",
"last_release_date"
]]
dp.DataTable(general_df)
general_df
```

## Turbine Modeling
Expand All @@ -87,8 +82,8 @@ turbine_df = df[[
"does_design_optimization",
"does_costs",
]]
turbine_df = turbine_df[ pd.DataFrame( turbine_df["scope"].tolist() ).isin( ["turbine", "any"] ).any(1).values ]
dp.DataTable(turbine_df)
turbine_df = turbine_df[ pd.DataFrame( turbine_df["scope"].tolist() ).isin( ["turbine", "any"] ).any(axis=1).values ]
turbine_df
```

## Farm Modeling
Expand All @@ -105,8 +100,8 @@ farm_df = df[[
"does_design_optimization",
"does_costs",
]]
farm_df = farm_df[ pd.DataFrame( farm_df["scope"].tolist() ).isin( ["farm", "any"] ).any(1).values ]
dp.DataTable(farm_df.dropna())
farm_df = farm_df[ pd.DataFrame( farm_df["scope"].tolist() ).isin( ["farm", "any"] ).any(axis=1).values ]
farm_df.dropna()
```

## Cost Modeling
Expand All @@ -121,7 +116,7 @@ cost_df = df[[
"tags",
]]
cost_df = cost_df[ cost_df["does_costs"] == True]
dp.DataTable(cost_df.dropna())
cost_df.dropna()
```

## Full Suite Modeling Comparison
Expand All @@ -143,7 +138,7 @@ modeling_df = df[[
"does_loads",
"tags",
]]
dp.DataTable(modeling_df)
modeling_df
```

## Distribution
Expand All @@ -156,7 +151,7 @@ distribution_df = df[[
"package_manager_url",
"installation_complexity",
]]
dp.DataTable(distribution_df)
distribution_df
```

## Documentation
Expand All @@ -176,7 +171,7 @@ documentation_df = df[[
"readability",
"project_coverage",
]]
dp.DataTable(documentation_df)
documentation_df
```

## Testing
Expand All @@ -190,7 +185,7 @@ testing_df = df[[
"test_documentation",
"performance_tests",
]]
dp.DataTable(testing_df)
testing_df
```

## Interfaces
Expand All @@ -203,7 +198,7 @@ interfaces_df = df[[
"language_interfaces",
"feature_accessibility",
]]
dp.DataTable(interfaces_df)
interfaces_df
```

## Input / Output
Expand All @@ -214,5 +209,5 @@ io_df = df[[
"filetypes",
"file_structure_stability",
]]
dp.DataTable(io_df)
io_df
```
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sphinx-simplepdf~=1.6

# attribute tables
# import altair as alt
datapane~=0.17
pandas~=1.5
itables~=2.2
pandas~=2.2
networkx
ghapi

0 comments on commit e914f40

Please sign in to comment.