diff --git a/dco/YashvardhanSingh.dco b/dco/YashvardhanSingh.dco new file mode 100644 index 00000000..b1fba510 --- /dev/null +++ b/dco/YashvardhanSingh.dco @@ -0,0 +1,9 @@ +1) I, Yashvardhan Singh, certify that all work committed with the commit message +"covered by: YashvardhanSingh.dco" is my original work and I own the copyright +to this work. I agree to contribute this code under the Apache 2.0 license. + +2) I understand and agree all contribution including all personal +information I submit with it is maintained indefinitely and may be +redistributed consistent with the open source license(s) involved. + +This certification is effective for all code contributed from 12-09-22 to 9999-01-01. \ No newline at end of file diff --git a/gs_quant/api/gs/carbon.py b/gs_quant/api/gs/carbon.py index 9bfb7037..69ff69e3 100644 --- a/gs_quant/api/gs/carbon.py +++ b/gs_quant/api/gs/carbon.py @@ -12,7 +12,10 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + +//Portions copyright . Licensed under Apache 2.0 license """ + import logging from enum import Enum from typing import Dict, List @@ -133,7 +136,8 @@ def get_carbon_analytics(cls, use_historical_data: bool = False, normalize_emissions: bool = False, cards: List[CarbonCard] = [], - analytics_view: CarbonAnalyticsView = CarbonAnalyticsView.LONG) -> Dict: + analytics_view: CarbonAnalyticsView = CarbonAnalyticsView.LONG, + scopes: List[CarbonScope] = []) -> Dict: url = f'/carbon/{entity_id}?' url += urlencode( dict(filter(lambda item: item[1] is not None, @@ -144,7 +148,8 @@ def get_carbon_analytics(cls, useHistoricalData=str(use_historical_data).lower(), normalizeEmissions=str(normalize_emissions).lower(), card=[c for c in CarbonCard] if len(cards) == 0 else cards, - analyticsView=analytics_view.value).items())), True) + analyticsView=analytics_view.value).items())), + scope=[s for s in CarbonScope] if len(scopes) == 0 else scopes, True) + - # TODO: Add scope as API parameter return GsSession.current._get(url)