terrakio-core 0.4.3__py3-none-any.whl → 0.4.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of terrakio-core might be problematic. Click here for more details.

@@ -177,4 +177,11 @@ class AuthClient:
177
177
  self._client.logger.info(f"API key updated in {config_path}")
178
178
 
179
179
  except Exception as e:
180
- self._client.logger.info(f"Warning: Failed to update config file: {e}")
180
+ self._client.logger.info(f"Warning: Failed to update config file: {e}")
181
+
182
+
183
+ # we have four different circumstances:
184
+ # same expression, different region
185
+ # same expression, same region
186
+ # different expression, same region
187
+ # different expression, different region
@@ -16,7 +16,7 @@ class MassStats:
16
16
  self,
17
17
  name: str,
18
18
  size: int,
19
- region: str,
19
+ sample: str,
20
20
  output: str,
21
21
  config: Dict[str, Any],
22
22
  overwrite: bool = False,
@@ -31,7 +31,7 @@ class MassStats:
31
31
  Args:
32
32
  name: The name of the job
33
33
  size: The size of the job
34
- region: The region of the job
34
+ sample: The sample expression for deciding which server to make the request to
35
35
  output: The output of the job
36
36
  config: The config of the job
37
37
  overwrite: Whether to overwrite the job
@@ -46,10 +46,11 @@ class MassStats:
46
46
  Raises:
47
47
  APIError: If the API request fails
48
48
  """
49
+ # we don't actually need the region function inside the request, the endpoint will fix that for us
49
50
  payload = {
50
51
  "name": name,
51
52
  "size": size,
52
- "region": region,
53
+ "sample": sample,
53
54
  "output": output,
54
55
  "config": config,
55
56
  "overwrite": overwrite,
@@ -396,7 +397,7 @@ class MassStats:
396
397
  async def execute_job(
397
398
  self,
398
399
  name: str,
399
- region: str,
400
+ # region: str,
400
401
  output: str,
401
402
  config: Dict[str, Any],
402
403
  request_json: str, # Path to request JSON file
@@ -411,7 +412,6 @@ class MassStats:
411
412
 
412
413
  Args:
413
414
  name: The name of the job
414
- region: The region of the job
415
415
  output: The output of the job
416
416
  config: The config of the job
417
417
  request_json: Path to the request JSON file
@@ -466,11 +466,16 @@ class MassStats:
466
466
  except Exception as e:
467
467
  raise ValueError(f"Error extracting manifest from request JSON: {e}")
468
468
 
469
+ # Extract the first expression
470
+ first_request = request_data[0] # Changed from data[0] to request_data[0]
471
+ first_expression = first_request["request"]["expr"]
472
+
469
473
  # Get upload URLs
470
474
  upload_result = await self._upload_request(
471
475
  name=name,
472
476
  size=size,
473
- region=region,
477
+ # region=region,
478
+ sample = first_expression,
474
479
  output=output,
475
480
  config=config,
476
481
  location=location,
@@ -552,7 +557,7 @@ class MassStats:
552
557
  tile_size: int,
553
558
  res: float,
554
559
  output: str,
555
- region: str,
560
+ # region: str,
556
561
  year_range: list[int] = None,
557
562
  overwrite: bool = False,
558
563
  server: str = None,
@@ -570,7 +575,6 @@ class MassStats:
570
575
  tile_size: The tile size of the job
571
576
  res: The resolution of the job
572
577
  output: The output of the job
573
- region: The region of the job
574
578
  year_range: The year range of the job
575
579
  overwrite: Whether to overwrite the job
576
580
  server: The server to use
@@ -596,7 +600,7 @@ class MassStats:
596
600
  payload_mapping = {
597
601
  "year_range": year_range,
598
602
  "server": server,
599
- "region": region,
603
+ # "region": region,
600
604
  "bucket": bucket,
601
605
  }
602
606
  for key, value in payload_mapping.items():