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

Only one profile for efficiency possible #117

Open
MaGering opened this issue Aug 1, 2023 · 4 comments · May be fixed by #118
Open

Only one profile for efficiency possible #117

MaGering opened this issue Aug 1, 2023 · 4 comments · May be fixed by #118
Assignees
Labels
bug Something isn't working

Comments

@MaGering
Copy link
Contributor

MaGering commented Aug 1, 2023

It is not possible to pass different foreign efficiency profiles, since the sequences name written into the datapackage.json is efficiency_profile for all components that have efficiency as attribute.

This is due to this code:

            # Define all undefined foreign keys for as <var name>_profile
            for key in foreign_keys:
                if key not in (
                    ["profile"] + list(config.FOREIGN_KEY_DESCRIPTORS)
                ):
                    if r.name in foreign_keys[key]:
                        r.descriptor["schema"]["foreignKeys"].append(
                            {
                                "fields": key,
                                "reference": {"resource": key + "_profile"},
                            }
                        )

In case where key equals to efficiency the name is set with reference to efficiency_profile. Instead it should be set to r.name + "_" + key + "_profile"

This way different efficiency sequences for different components can be passed.

@MaGering MaGering self-assigned this Aug 1, 2023
@MaGering MaGering added the bug Something isn't working label Aug 1, 2023
@MaGering MaGering linked a pull request Aug 1, 2023 that will close this issue
1 task
@nailend
Copy link
Collaborator

nailend commented Aug 2, 2023

@MaGering I am not sure if I understand the problem. Wouldn't it be enough to just pass another foreign key to the infer method and save the additional profiles in a separate csv file? At least, this is how its currently handled.

building.infer_metadata(
    package_name="oemof-tabular-dispatch-example",
    foreign_keys={
        "bus": ["volatile", "dispatchable", "storage", "load"],
        "profile": ["load", "volatile"],
        "from_to_bus": ["link"],
        "chp": [],
        "a_efficiency": ["dispatchable"],
        "b_efficiency": ["dispatchable"],
    },
    **kwargs,
)

@nailend
Copy link
Collaborator

nailend commented Aug 3, 2023

I think I am getting it: You are having multiple components of the same type, e.g. heat_pumps, but you don't want to give all of them the same efficiencies due to e.g. local differences.

In this case it should be enough to write different names in the cells of the efficiency column of your component.
Compare with the volatile component and respective volatile_profiles

@MaGering
Copy link
Contributor Author

MaGering commented Aug 3, 2023

I think I am getting it: You are having multiple components of the same type, e.g. heat_pumps, but you don't want to give all of them the same efficiencies due to e.g. local differences.

In this case it should be enough to write different names in the cells of the efficiency column of your component. Compare with the volatile component and respective volatile_profiles

Yes exactly, that's the case where the problem occurs. For the field profile this works just fine. But how about that efficiency or marginal_cost etc.?

Concerning the solution in your first comment: Will oemof.tabular map it to the correct attribute if I put for example "heatpump_small_efficiency" in front of it? I assumed that the key must be named exactly the same as the name of the attribute. So that the key must be called marginal_cost for example and not wind_marginal_cost.

@nailend
Copy link
Collaborator

nailend commented Mar 28, 2024

@MaGering sorry for not answering... is this solved anyways?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants