Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Set up Java
uses: actions/setup-java@v6.0.1
with:
distribution: 'temurin'
java-version: 22

- name: Download package
uses: actions/download-artifact@v8
with:
Expand All @@ -71,5 +65,7 @@ jobs:
uv pip install --system "$(ls dist/*.whl)[dev]"

- name: Test with pytest
env:
MPLBACKEND: Agg
run: |
pytest
73 changes: 0 additions & 73 deletions LICENSES/Apache-2.0.txt

This file was deleted.

2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
# SPDX-License-Identifier: MIT

include powerplantmatching/package_data/*
include powerplantmatching/package_data/duke_binaries/*
include README.md LICENSE
include requirements.yaml
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ and/or the current release stored on Zenodo with a release-specific DOI:

`powerplantmatching` is released as free software under the [MIT](LICENSES/MIT.txt) license.
The default output data [powerplants.csv](powerplants.csv) generated by the package is released under [CC BY 4.0](LICENSES/CC-BY-4.0.txt).
Parts of the repository may be licensed under different licenses, especially dependent package binaries for `duke` being licensed under [Apache 2.0 license](https://github.com/PyPSA/powerplantmatching/tree/master/LICENSES/Apache-2.0.txt).

This repository uses the [REUSE](https://reuse.software/) conventions to indicate the licenses that apply to individual files and parts of the repository.
For details on the licenses that apply, see the the header information of the respective files and [REUSE.toml](REUSE.toml) for details.
Expand Down
8 changes: 0 additions & 8 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,3 @@ path = [
]
SPDX-FileCopyrightText = "Contributors to powerplantmatching <https://github.com/pypsa/powerplantmatching>"
SPDX-License-Identifier = "CC0-1.0"


[[annotations]]
path = [
"powerplantmatching/package_data/duke_binaries/*.jar",
]
SPDX-FileCopyrightText = "Lars Marius Garshol <larsga@garshol.priv.no>"
SPDX-License-Identifier = "Apache-2.0"
2 changes: 1 addition & 1 deletion docs/api-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ SPDX-License-Identifier: MIT

::: powerplantmatching.core

::: powerplantmatching.duke
::: powerplantmatching.linkage

::: powerplantmatching.accessor
1 change: 0 additions & 1 deletion docs/license.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ SPDX-License-Identifier: MIT

`powerplantmatching` is released as free software under the [MIT](LICENSES/MIT.txt) license.
The default output data [powerplants.csv](powerplants.csv) generated by the package is released under [CC BY 4.0](LICENSES/CC-BY-4.0.txt).
Parts of the repository may be licensed under different licenses, especially dependent package binaries for `duke` being licensed under [Apache 2.0 license](https://github.com/PyPSA/powerplantmatching/tree/master/LICENSES/Apache-2.0.txt).

This repository uses the [REUSE](https://reuse.software/) conventions to indicate the licenses that apply to individual files and parts of the repository.
For details on the licenses that apply, see the the header information of the respective files and [REUSE.toml](REUSE.toml) for details.
Expand Down
5 changes: 4 additions & 1 deletion docs/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ SPDX-License-Identifier: MIT

## Upcoming Version

*
* Replace Java DUKE with a blocked Python matcher using rapidfuzz. Java, the bundled jars, XML matching files and `powerplantmatching.duke` are removed. Matching results change.
* Score plant names symmetrically and select fuzzy links with sparse maximum-score one-to-one assignment. Exact EIC matching still runs first and accepts only isolated one-to-one pairs.
* Preserve EICs as sorted unique lists throughout unit aggregation, reduction and cached reload. Missing EICs are `[]`.
* Rename `parallel_duke_processes` to `parallel_processes`. Update custom configuration keys; no compatibility alias is provided.

## [v0.9.0](https://github.com/PyPSA/powerplantmatching/releases/tag/v0.9.0) (3rd October 2026)

Expand Down
4 changes: 2 additions & 2 deletions powerplantmatching/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ def set_name(self, name):
def get_name(self):
return self._obj.columns.name

def match_with(self, df, labels=None, config=None, reduced=True, **dukeargs):
def match_with(self, df, labels=None, config=None, reduced=True, **matchargs):
from .matching import combine_multiple_datasets, reduce_matched_dataframe
from .utils import to_list_if_other

dfs = [self._obj] + to_list_if_other(df)
res = combine_multiple_datasets(dfs, labels, config=config, **dukeargs)
res = combine_multiple_datasets(dfs, labels, config=config, **matchargs)
if reduced:
return res.pipe(reduce_matched_dataframe, config=config)
return res
Expand Down
10 changes: 5 additions & 5 deletions powerplantmatching/cleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from deprecation import deprecated

from .core import PANDAS_V3, get_config, get_obj_if_Acc
from .duke import duke
from .utils import get_name, set_column_name
from .linkage import match
from .utils import collect_eic_codes, get_name, set_column_name

logger = logging.getLogger(__name__)

Expand All @@ -44,7 +44,7 @@ def mode(x):
"DateOut": "max",
"File": mode,
"projectID": set,
"EIC": set,
"EIC": collect_eic_codes,
"Duration": "sum", # note this is weighted sum
"Volume_Mm3": "sum",
"DamHeight_m": "sum",
Expand Down Expand Up @@ -505,11 +505,11 @@ def aggregate_units(
country_query = "Country == @c"
query = " and ".join(filter(None, [agg_query, block_query, country_query]))
duplicates = pd.concat(
[duke(df.query(query), threads=threads) for c in countries]
[match(df.query(query), threads=threads) for c in countries]
)
else:
query = " and ".join(filter(None, [agg_query, block_query]))
duplicates = duke(df.query(query) if query else df, threads=threads)
duplicates = match(df.query(query) if query else df, threads=threads)

df = cliques(df, duplicates)
df = df.groupby("grouped").agg(props_for_groups)
Expand Down
6 changes: 3 additions & 3 deletions powerplantmatching/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def collect(
update=False,
reduced=True,
config=None,
**dukeargs,
**matchargs,
):
"""
Return the collection for a given list of datasets in matched or
Expand All @@ -47,7 +47,7 @@ def collect(
Switch as to return the reduced (True) or matched (False) dataset.
config : dict
Configuration file of powerplantmatching
**dukeargs : keyword-args for duke
**matchargs : keyword arguments for matching
"""

from . import data
Expand Down Expand Up @@ -88,7 +88,7 @@ def df_by_name(name):

if update:
dfs = parmap(df_by_name, datasets)
matched = combine_multiple_datasets(dfs, datasets, config=config, **dukeargs)
matched = combine_multiple_datasets(dfs, datasets, config=config, **matchargs)
(
matched.assign(projectID=lambda df: df.projectID.astype(str)).to_csv(
outfn_matched, index_label="id"
Expand Down
5 changes: 5 additions & 0 deletions powerplantmatching/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ def get_config(filename=None, **overrides):
config.update(yaml.load(f, Loader=yaml.FullLoader))
config.update(overrides)

if "parallel_duke_processes" in config:
raise ValueError(
"Rename parallel_duke_processes to parallel_processes in your configuration"
)

sha1digest = sha1(cPickle.dumps(overrides)).digest()
if len(dict(**overrides)) == 0:
config["hash"] = "default"
Expand Down
Loading
Loading