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

Changes to AI profile to accommodate expressing energyConsumption #697

Merged
merged 18 commits into from
Apr 8, 2024

Conversation

rgopikrishnan91
Copy link
Contributor

@kestewart @goneall This is part 4 of the PR. Please review it. With this the changes we discussed for Energy consumption should be done.

Copy link
Member

@goneall goneall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple changes to be consistent with the naming conventions

model/AI/Vocabularies/EnergyConsumptionDescriptionUnitType Outdated Show resolved Hide resolved
@kestewart kestewart added this to the 3.0 milestone Apr 4, 2024
@kestewart kestewart added the Profile:AI Artificial intelligence profile label Apr 4, 2024
@rgopikrishnan91
Copy link
Contributor Author

Signed-off-by: Gopi Krishnan Rajbahadur gopikrishnanrajbahadur@gmail.com

@rgopikrishnan91 rgopikrishnan91 changed the title Create EnergyConsumptionDescriptionUnitType Changes to AI profile to accommodate expressing energyConsumption Apr 4, 2024
@rgopikrishnan91
Copy link
Contributor Author

@bact @goneall @kestewart Please take a look at this PR. I have made the requested changes and combined all the changes here. Please let me know your thoughts.

Copy link
Member

@goneall goneall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few file renamings requested. Note - the renamed files will trigger a more robust CI checking.

model/AI/Classes/EnergyConsumption Outdated Show resolved Hide resolved
model/AI/Classes/EnergyConsumptionDescription Outdated Show resolved Hide resolved
model/AI/Vocabularies/EnergyConsumptionDescriptionUnitType Outdated Show resolved Hide resolved
model/AI/Vocabularies/EnergyConsumptionDescriptionUnitType Outdated Show resolved Hide resolved
@kestewart
Copy link
Contributor

@rgopikrishnan91 - can you apply the file extension changes that Gary flagged, and the clarification of kWh from Art, and then I'lll apply this. Merged patch looks good - thanks for doing this.

@rgopikrishnan91
Copy link
Contributor Author

@kestewart @goneall @bact I have made the request changes. Could you guys please review it and merge it?

@rgopikrishnan91
Copy link
Contributor Author

Not sure what the parser is complaining about..I haven't changed anything drastic...

@goneall
Copy link
Member

goneall commented Apr 6, 2024

Thanks @rgopikrishnan91

It looks like the validation is failing:

0s
Run python /home/runner/work/_temp/spec-parser/main.py -n model
Traceback (most recent call last):
  File "/home/runner/work/_temp/spec-parser/main.py", line [1](https://github.com/spdx/spdx-3-model/actions/runs/8584156125/job/23524144900?pr=697#step:5:1)1, in <module>
    m = Model(cfg.input_dir)
        ^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/_temp/spec-parser/spec_parser/model.py", line 28, in __init__
    self.load(dir)
  File "/home/runner/work/_temp/spec-parser/spec_parser/model.py", line 96, in load
    proptype = self.properties[pname].metadata["Range"]
               ~~~~~~~~~~~~~~~^^^^^^^
KeyError: '/AI/value'

I haven't had time to research, but there is probably a reference to a class or property with the name value without a corresponding definition.

@zvr
Copy link
Member

zvr commented Apr 6, 2024

Yes, @goneall and @rgopikrishnan91 :
this PR introduces EnergyConsumptionDescription which uses properties value and unit, but there are no definitions of these properties.

@goneall
Copy link
Member

goneall commented Apr 6, 2024

Yes, @goneall and @rgopikrishnan91 : this PR introduces EnergyConsumptionDescription which uses properties value and unit, but there are no definitions of these properties.

Thanks @zvr - @rgopikrishnan91 - you'll need to add property files for value and unit to resolve.

@bact
Copy link
Collaborator

bact commented Apr 7, 2024

Thank you @rgopikrishnan91 and @zvr.

If so, since:

could we also rename them to energyQuantity and energyUnit?

Also shorten EnergyConsumptionDescriptionUnitType to EnergyUnitType as the type can be used for energy unit of any purpose.

They may all look like this:


(1) [MODIFIED] model/AI/Classes/EnergyConsumptionDescription.md

SPDX-License-Identifier: Community-Spec-1.0

# EnergyConsumptionDescription

## Summary

The class that helps note down the quantity of energy consumption and the unit
used for measurement.

## Description

This class is designed to store energy consumption data, including the quantity
and the unit of measurement.

The energyQuantity property stores the amount of energy consumed,
and the energyUnit property stores the unit used for measurement.

## Metadata

- name: EnergyConsumptionDescription
- Instantiability: Concrete

## Properties

- energyQuantity
  - type: xsd:decimal
  - minCount: 1
  - maxCount: 1
- energyUnit
  - type: EnergyUnitType
  - minCount: 1
  - maxCount: 1

(2) [NEW] model/AI/Properties/energyQuantity.md

SPDX-License-Identifier: Community-Spec-1.0

# energyQuantity

## Summary

Represents the energy quantity.

## Description

Provides the quantity information of the energy.

## Metadata

- name: energyQuantity
- Nature: DataProperty
- Range: xsd:decimal

(3) [NEW] model/AI/Properties/energyUnit.md

SPDX-License-Identifier: Community-Spec-1.0

# energyUnit

## Summary

Specifies the unit in which energy is measured.

## Description

Provides the unit information of the energy.

## Metadata

- name: energyUnit
- Nature: ObjectProperty
- Range: EnergyUnitType

(4) [MODIFIED] model/AI/Vocabularies/EnergyUnitType.md

(Was: model/AI/Vocabularies/EnergyConsumptionDescriptionUnitType.md)

SPDX-License-Identifier: Community-Spec-1.0

# EnergyUnitType

## Summary

Specifies the unit of energy consumption.

## Description

List the different acceptable units for measuring energy consumption.

If the unit in which the energy consumption has been recorded
is not listed here, please select "other".

## Metadata

- name: EnergyUnitType

## Entries

- kilowattHour: Kilowatt-hour.
- megajoule: Megajoule.
- other: Any other units of energy measurement. 

Thanks Gopi again for all the efforts.

Copy link
Contributor

@kestewart kestewart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rgopikrishnan91 - can you apply the fixes that Art, Alexios & Gary suggest?

Copy link
Contributor

@kestewart kestewart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments from Art, Alexios & Gary

@rgopikrishnan91
Copy link
Contributor Author

@kestewart @goneall @bact @zvr Hi thanks for all the comments and feedback. I have made the required changes and the parser seems to be happy now. Please let me know if these changes look good.

Copy link
Contributor

@kestewart kestewart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me - @bact, @zvr - can you take a look?

@bact
Copy link
Collaborator

bact commented Apr 8, 2024

Looks good to me as well. Thank you everyone.

@kestewart kestewart merged commit 9de9705 into spdx:main Apr 8, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Profile:AI Artificial intelligence profile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants