-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.6 Add Environmental considerations for ML and address for organization
Signed-off-by: Alex Alzate <[email protected]>
- Loading branch information
Showing
14 changed files
with
486 additions
and
5 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
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
37 changes: 37 additions & 0 deletions
37
...ava/org/cyclonedx/model/component/modelCard/consideration/EnvironmentalConsideration.java
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,37 @@ | ||
package org.cyclonedx.model.component.modelCard.consideration; | ||
|
||
import java.util.List; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; | ||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; | ||
import org.cyclonedx.model.Property; | ||
import org.cyclonedx.model.component.modelCard.consideration.consumption.EnergyConsumption; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
public class EnvironmentalConsideration | ||
{ | ||
private List<EnergyConsumption> energyConsumptions; | ||
|
||
private List<Property> properties; | ||
|
||
public List<EnergyConsumption> getEnergyConsumptions() { | ||
return energyConsumptions; | ||
} | ||
|
||
public void setEnergyConsumptions(final List<EnergyConsumption> energyConsumptions) { | ||
this.energyConsumptions = energyConsumptions; | ||
} | ||
|
||
@JacksonXmlElementWrapper(localName = "properties") | ||
@JacksonXmlProperty(localName = "property") | ||
public List<Property> getProperties() { | ||
return properties; | ||
} | ||
|
||
public void setProperties(final List<Property> properties) { | ||
this.properties = properties; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...main/java/org/cyclonedx/model/component/modelCard/consideration/consumption/Activity.java
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,35 @@ | ||
package org.cyclonedx.model.component.modelCard.consideration.consumption; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public enum Activity | ||
{ | ||
@JsonProperty("design") | ||
DESIGN("design"), | ||
@JsonProperty("data-collection") | ||
DATA_COLLECTION("data-collection"), | ||
@JsonProperty("data-preparation") | ||
DATA_PREPARATION("data-preparation"), | ||
@JsonProperty("training") | ||
TRAINING("training"), | ||
@JsonProperty("fine-tuning") | ||
FINE_TUNING("fine-tuning"), | ||
@JsonProperty("validation") | ||
VALIDATION("validation"), | ||
@JsonProperty("deployment") | ||
DEPLOYMENT("deployment"), | ||
@JsonProperty("inference") | ||
INFERENCE("inference"), | ||
@JsonProperty("other") | ||
OTHER("other"); | ||
|
||
private final String name; | ||
|
||
Activity(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
.../org/cyclonedx/model/component/modelCard/consideration/consumption/EnergyConsumption.java
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,75 @@ | ||
package org.cyclonedx.model.component.modelCard.consideration.consumption; | ||
|
||
import java.util.List; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; | ||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; | ||
import org.cyclonedx.model.Property; | ||
import org.cyclonedx.model.component.modelCard.consideration.consumption.co2.CO2Measure; | ||
import org.cyclonedx.model.component.modelCard.consideration.consumption.energy.EnergyMeasure; | ||
import org.cyclonedx.model.component.modelCard.consideration.consumption.energy.EnergyProvider; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
public class EnergyConsumption | ||
{ | ||
private Activity activity; | ||
private List<EnergyProvider> energyProviders; | ||
private EnergyMeasure activityEnergyCost; | ||
private CO2Measure co2CostEquivalent; | ||
private CO2Measure co2CostOffset; | ||
private List<Property> properties; | ||
|
||
public Activity getActivity() { | ||
return activity; | ||
} | ||
|
||
public void setActivity(final Activity activity) { | ||
this.activity = activity; | ||
} | ||
|
||
@JacksonXmlElementWrapper(useWrapping = false) | ||
public List<EnergyProvider> getEnergyProviders() { | ||
return energyProviders; | ||
} | ||
|
||
public void setEnergyProviders(final List<EnergyProvider> energyProviders) { | ||
this.energyProviders = energyProviders; | ||
} | ||
|
||
public EnergyMeasure getActivityEnergyCost() { | ||
return activityEnergyCost; | ||
} | ||
|
||
public void setActivityEnergyCost(final EnergyMeasure activityEnergyCost) { | ||
this.activityEnergyCost = activityEnergyCost; | ||
} | ||
|
||
public CO2Measure getCo2CostEquivalent() { | ||
return co2CostEquivalent; | ||
} | ||
|
||
public void setCo2CostEquivalent(final CO2Measure co2CostEquivalent) { | ||
this.co2CostEquivalent = co2CostEquivalent; | ||
} | ||
|
||
public CO2Measure getCo2CostOffset() { | ||
return co2CostOffset; | ||
} | ||
|
||
public void setCo2CostOffset(final CO2Measure co2CostOffset) { | ||
this.co2CostOffset = co2CostOffset; | ||
} | ||
|
||
@JacksonXmlElementWrapper(localName = "properties") | ||
@JacksonXmlProperty(localName = "property") | ||
public List<Property> getProperties() { | ||
return properties; | ||
} | ||
|
||
public void setProperties(final List<Property> properties) { | ||
this.properties = properties; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...ava/org/cyclonedx/model/component/modelCard/consideration/consumption/co2/CO2Measure.java
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,28 @@ | ||
package org.cyclonedx.model.component.modelCard.consideration.consumption.co2; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
public class CO2Measure | ||
{ | ||
private double value; | ||
private Unit unit; | ||
|
||
public double getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(final double value) { | ||
this.value = value; | ||
} | ||
|
||
public Unit getUnit() { | ||
return unit; | ||
} | ||
|
||
public void setUnit(final Unit unit) { | ||
this.unit = unit; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...main/java/org/cyclonedx/model/component/modelCard/consideration/consumption/co2/Unit.java
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,19 @@ | ||
package org.cyclonedx.model.component.modelCard.consideration.consumption.co2; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public enum Unit | ||
{ | ||
@JsonProperty("tCO2eq") | ||
TCO2EQ("tCO2eq"); | ||
|
||
private final String name; | ||
|
||
Unit(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...g/cyclonedx/model/component/modelCard/consideration/consumption/energy/EnergyMeasure.java
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,28 @@ | ||
package org.cyclonedx.model.component.modelCard.consideration.consumption.energy; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
public class EnergyMeasure | ||
{ | ||
private double value; | ||
private Unit unit; | ||
|
||
public double getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(final double value) { | ||
this.value = value; | ||
} | ||
|
||
public Unit getUnit() { | ||
return unit; | ||
} | ||
|
||
public void setUnit(final Unit unit) { | ||
this.unit = unit; | ||
} | ||
} |
78 changes: 78 additions & 0 deletions
78
.../cyclonedx/model/component/modelCard/consideration/consumption/energy/EnergyProvider.java
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,78 @@ | ||
package org.cyclonedx.model.component.modelCard.consideration.consumption.energy; | ||
|
||
import java.util.List; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; | ||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; | ||
import org.cyclonedx.model.ExternalReference; | ||
import org.cyclonedx.model.OrganizationalEntity; | ||
import org.cyclonedx.util.deserializer.ExternalReferencesDeserializer; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
public class EnergyProvider | ||
{ | ||
@JacksonXmlProperty(isAttribute = true, localName = "bom-ref") | ||
@JsonProperty("bom-ref") | ||
private String bomRef; | ||
private String description; | ||
private OrganizationalEntity organization; | ||
private EnergySource energySource; | ||
private EnergyMeasure energyProvided; | ||
private List<ExternalReference> externalReferences; | ||
|
||
public String getBomRef() { | ||
return bomRef; | ||
} | ||
|
||
public void setBomRef(final String bomRef) { | ||
this.bomRef = bomRef; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(final String description) { | ||
this.description = description; | ||
} | ||
|
||
public OrganizationalEntity getOrganization() { | ||
return organization; | ||
} | ||
|
||
public void setOrganization(final OrganizationalEntity organization) { | ||
this.organization = organization; | ||
} | ||
|
||
public EnergySource getEnergySource() { | ||
return energySource; | ||
} | ||
|
||
public void setEnergySource(final EnergySource energySource) { | ||
this.energySource = energySource; | ||
} | ||
|
||
public EnergyMeasure getEnergyProvided() { | ||
return energyProvided; | ||
} | ||
|
||
public void setEnergyProvided(final EnergyMeasure energyProvided) { | ||
this.energyProvided = energyProvided; | ||
} | ||
|
||
@JacksonXmlElementWrapper(localName = "externalReferences") | ||
@JacksonXmlProperty(localName = "reference") | ||
@JsonDeserialize(using = ExternalReferencesDeserializer.class) | ||
public List<ExternalReference> getExternalReferences() { | ||
return externalReferences; | ||
} | ||
|
||
public void setExternalReferences(final List<ExternalReference> externalReferences) { | ||
this.externalReferences = externalReferences; | ||
} | ||
} |
Oops, something went wrong.