internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: ourownstory/neural_prophet

Issue:
Re-add compatibility with NumPy >=1.24
**Prerequisites**

* [x] Put an X between the brackets on this line if you have done all of the following:
    * Checked the Answered Questions on the Github Disscussion board: https://github.com/ourownstory/neural_prophet/discussions
      If you have the same question but the Answer does not solve your issue, please continue the conversation there.
    * Checked that your issue isn't already filed: https://github.com/ourownstory/neural_prophet/issues
      If you have the same issue but there is a twist to your situation, please add an explanation there.
    * Considered whether your issue might need further discussing before being defined as a feature request:
      Please [post an idea or feedback](https://github.com/ourownstory/neural_prophet/discussions/categories/ideas-feedback)

**Is your feature request related to a problem? Please describe.**

We are currently rebuilding our Apache Airflow setup with the use of [constraints files](https://raw.githubusercontent.com/apache/airflow/constraints-2.6.3/constraints-3.10.txt), to keep all the dependencies in check somehow. However this means we _have_ to use NumPy 1.24, and unfortunately this version was declared non-compatible in #1080. However there were no issues linked, so I have no idea if this is still a problem, but there were plenty of updated to matplotlib in the mean time and I hope this issue is gone, maybe @karl-richter can answer this?

**Describe the solution you'd like**

Declare this library compatible with NumPy 1.24 or even 1.25.

**Describe alternatives you've considered**

None.

**Additional context**





Discussion:

Resolving patch:
diff --git a/neuralprophet/plot_model_parameters_matplotlib.py b/neuralprophet/plot_model_parameters_matplotlib.py
--- a/neuralprophet/plot_model_parameters_matplotlib.py
+++ b/neuralprophet/plot_model_parameters_matplotlib.py
@@ -265,9 +265,12 @@ def plot_trend(m, quantile, ax=None, plot_name="Trend", figsize=(10, 6), df_name
             trend_1 = trend_0
         else:
             if m.model.config_trend.trend_global_local == "local":
-                trend_1 = trend_0 + m.model.trend.trend_k0[quantile_index, m.model.id_dict[df_name]].detach().numpy()
+                trend_1 = (
+                    trend_0
+                    + m.model.trend.trend_k0[quantile_index, m.model.id_dict[df_name]].detach().numpy().squeeze()
+                )
             else:
-                trend_1 = trend_0 + m.model.trend.trend_k0[quantile_index, 0].detach().numpy()
+                trend_1 = trend_0 + m.model.trend.trend_k0[quantile_index, 0].detach().numpy().squeeze()
 
         data_params = m.config_normalization.get_data_params(df_name)
         shift = data_params["y"].shift


Test patch:
Repository: ourownstory/neural_prophet

Issue:
Plotting warning for global model is wrong
When fitting a global model and calling `m.plot_parameters` the following warning makes no sense as the parameters are all the same for every ID. 

<img width="1113" alt="image" src="https://github.com/ourownstory/neural_prophet/assets/42536262/29d34879-50d2-43f3-a906-97d70fc1c109">



Discussion:
E.g. in tutorial https://neuralprophet.com/tutorials/tutorial09.html, all plots for different IDs look the same (as it should be, so no warning is needed)
`m.plot_parameters(df_name=df['ID'].unique()[id])`
for id = 0, 1, 2, 3, ...

Resolving patch:
diff --git a/neuralprophet/plot_utils.py b/neuralprophet/plot_utils.py
--- a/neuralprophet/plot_utils.py
+++ b/neuralprophet/plot_utils.py
@@ -304,10 +304,6 @@ def get_valid_configuration(  # move to utils
                         )
                     else:
                         df_name = m.id_list[0]
-                        log.warning(
-                            "Local model set with > 1 time series in the pd.DataFrame. Plotting components of first \
-                                time series. "
-                        )
                 else:
                     log.warning("Local normalization set, but df_name is None. Using global data params instead.")
                     df_name = "__df__"


Test patch:
Repository: microsoft/AzureTRE

Issue:
Application Insights configuration for processor function broken
The `createNewWorkspace` function monitoring blade indicates that Application Insights integration is not enabled.
![image](https://user-images.githubusercontent.com/166592/123793166-b7edfa80-d8e1-11eb-8906-b4175f4348e0.png)

At a first glance, the config seems to be there in [processor_function/function.tf](https://github.com/microsoft/AzureTRE/blob/develop/templates/core/terraform/processor_function/function.tf#L24)
```plaintext
    APP_INSIGHTS_INSTRUMENTATION_KEY      = var.app_insights_instrumentation_key
```
however, the setting key name is incorrect.

Manually enabling the integration in the portal adds additional config keys:

`APPLICATIONINSIGHTS_CONNECTION_STRING`
`APPINSIGHTS_INSTRUMENTATIONKEY`

Need to add above keys with values to function app config.

[Reference](https://docs.microsoft.com/en-us/azure/azure-monitor/app/resource-manager-function-app)


Discussion:

Resolving patch:
diff --git a/processor_function/shared/logging.py b/processor_function/shared/logging.py
--- a/processor_function/shared/logging.py
+++ b/processor_function/shared/logging.py
@@ -18,10 +18,10 @@ def initialize_logging(logging_level: int, correlation_id: str) -> logging.Logge
     """
     logger = logging.getLogger()
     logger.addHandler(logging.StreamHandler())  # For logging into console
-    app_insights_instrumentation_key = os.getenv("APP_INSIGHTS_INSTRUMENTATION_KEY")
+    app_insights_connection_string = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING")
 
     try:
-        logger.addHandler(AzureLogHandler(connection_string=f"InstrumentationKey={app_insights_instrumentation_key}"))
+        logger.addHandler(AzureLogHandler(connection_string=app_insights_connection_string))
     except ValueError as e:
         logger.error(f"Failed to set Application Insights logger handler: {e}")
 


Test patch:
Repository: microsoft/AzureTRE

Issue:
[BUG] Service bus message times out on deployment of workspace template 
**Describe the bug**
When deploying a template that takes > 10 minutes, although deployment is successful the status is not updated.

**Steps to reproduce**

1. Register and deploy the `azureml_devtestlabs` workspace
2. Log on to the VMSS resource processor using bastion
3. View the docker logs,  wait until deployment is complete, and see similar to:

`LinkDetach("ErrorCodes.LinkDetachForced: The link 'G3:5725658:sender-link-bd7b69d4-9ad4-4b9b-b9f6-2e311be400a3' is force detached. Code: publisher(link3135). Details: AmqpMessagePublisher.IdleTimerExpired: Idle timeout: 00:10:00.")`







Discussion:

Resolving patch:
diff --git a/processor_function/vm_porter/runner.py b/processor_function/vm_porter/runner.py
--- a/processor_function/vm_porter/runner.py
+++ b/processor_function/vm_porter/runner.py
@@ -33,7 +33,7 @@ async def receive_message(env_vars, service_bus_client):
     """
     async with service_bus_client:
         q_name = env_vars["resource_request_queue"]
-        renewer = AutoLockRenewer()
+        renewer = AutoLockRenewer(max_lock_renewal_duration=1800)
         receiver = service_bus_client.get_queue_receiver(queue_name=q_name, auto_lock_renewer=renewer)
 
         async with receiver:


Test patch:
Repository: microsoft/AzureTRE

Issue:
[BUG] Failed workspace deployment: only one positional argument may be specified, the installation name, but multiple were received
**Describe the bug**
Workspace deployment failed with:

```
only one positional argument may be specified, the installation name, but multiple were received [mrtre17-9c1d X secure project]
```

**Steps to reproduce**

Deployed a workspace with following values:

```
"azure_location":"westeurope",
"workspace_id":"9c1d",
"tre_id":"mrtre17",
"address_space":"192.168.10.0/24",
"display_name":"Project X",
"description":"Very secure project"
```


Discussion:
This seems to be caused by parameter values not being enclosed with quotations in the porter command.
I saw the same and believe it's about the description having multiple words - one word works just fine.

Resolving patch:
diff --git a/resource_processor/vmss_porter/runner.py b/resource_processor/vmss_porter/runner.py
--- a/resource_processor/vmss_porter/runner.py
+++ b/resource_processor/vmss_porter/runner.py
@@ -99,7 +99,7 @@ async def build_porter_command(msg_body, env_vars):
 
     porter_keys = await filter_parameters_not_needed_by_porter(msg_body, env_vars)
     for parameter in porter_keys:
-        porter_parameters = porter_parameters + f" --param {parameter}={msg_body['parameters'][parameter]}"
+        porter_parameters = porter_parameters + f" --param {parameter}=\"{msg_body['parameters'][parameter]}\""
 
     installation_id = msg_body['parameters']['tre_id'] + "-" + msg_body['parameters']['workspace_id']
 
@@ -109,7 +109,7 @@ async def build_porter_command(msg_body, env_vars):
     porter_parameters = porter_parameters + f" --param arm_use_msi={env_vars['arm_use_msi']}"
 
     command_line = [f"{azure_login_command(env_vars)} && az acr login --name {env_vars['registry_server'].replace('.azurecr.io','')} && porter "
-                    f"{msg_body['action']} {installation_id} "
+                    f"{msg_body['action']} \"{installation_id}\" "
                     f" --reference {env_vars['registry_server']}/{msg_body['name']}:v{msg_body['version']}"
                     f" {porter_parameters} --cred ./vmss_porter/azure.json --allow-docker-host-access"
                     f" && porter show {installation_id}"]
@@ -174,7 +174,7 @@ async def deploy_porter_bundle(msg_body, sb_client, env_vars, message_logger_ada
     porter_command = await build_porter_command(msg_body, env_vars)
     returncode, _, err = await run_porter(porter_command, env_vars)
     if returncode != 0:
-        error_message = "Error context message = " + " ".join(err.split('\n'))
+        error_message = "Error context message = " + " ".join(err.split('\n')) + " ; Command executed: ".join(porter_command)
         resource_request_message = service_bus_message_generator(msg_body, strings.RESOURCE_STATUS_FAILED, error_message)
         await sb_sender.send_messages(ServiceBusMessage(body=resource_request_message, correlation_id=msg_body["id"]))
         message_logger_adapter.info(f"{installation_id}: Deployment job configuration failed error = {error_message}")


Test patch:
Repository: microsoft/AzureTRE

Issue:
[Task] Modify InnerEye Deeplearning service so it can be registered with API
Story: #694 

**Description**
Modify InnerEye Deeplearning service so template can be registered with publish_register_bundle.sh



Discussion:

Resolving patch:
diff --git a/resource_processor/vmss_porter/runner.py b/resource_processor/vmss_porter/runner.py
--- a/resource_processor/vmss_porter/runner.py
+++ b/resource_processor/vmss_porter/runner.py
@@ -139,7 +139,7 @@ async def build_porter_command(msg_body, env_vars):
     command_line = [f"{azure_login_command(env_vars)} && {azure_acr_login_command(env_vars)} && porter "
                     f"{msg_body['action']} \"{installation_id}\" "
                     f" --reference {env_vars['registry_server']}/{msg_body['name']}:v{msg_body['version']}"
-                    f" {porter_parameters} --cred ./vmss_porter/azure.json --allow-docker-host-access"
+                    f" {porter_parameters} --cred ./vmss_porter/azure.json --allow-docker-host-access --force"
                     f" && porter show {installation_id}"]
     return command_line
 


Test patch:
Repository: microsoft/AzureTRE

Issue:
Version the API images (tag)



Discussion:
Should the docker image tag version match the API version. Using semantic versioning, then the build number could be the actual github build action number.

- Changes to the API must trigger a version update e.g. 1.1 -> 1.2
- Fixes to business logic (hence a new docker image) would be okay only updating the build number

Resolving patch:
diff --git a/api_app/_version.py b/api_app/_version.py
new file mode 100644
--- /dev/null
+++ b/api_app/_version.py
@@ -0,0 +1 @@
+__version__ = "0.1.0"
diff --git a/api_app/core/config.py b/api_app/core/config.py
--- a/api_app/core/config.py
+++ b/api_app/core/config.py
@@ -1,5 +1,5 @@
 from starlette.config import Config
-
+from _version import __version__
 
 config = Config(".env")
 
@@ -7,7 +7,7 @@
 API_PREFIX = "/api"
 PROJECT_NAME: str = config("PROJECT_NAME", default="Azure TRE API")
 DEBUG: bool = config("DEBUG", cast=bool, default=False)
-VERSION = "0.1.0"
+VERSION = __version__
 API_DESCRIPTION = "Welcome to the Azure TRE API - for more information about templates and workspaces see the [Azure TRE documentation](https://github.com/microsoft/AzureTRE/blob/main/docs/concepts.md)"
 
 # Resource Info


Test patch:
diff --git a/e2e_tests/test_workspace_service_creation.py b/e2e_tests/test_workspace_service_creation.py
--- a/e2e_tests/test_workspace_service_creation.py
+++ b/e2e_tests/test_workspace_service_creation.py
@@ -13,8 +13,7 @@
 workspace_service_templates = [
     (strings.AZUREML_SERVICE),
     (strings.DEVTESTLABS_SERVICE),
-    (strings.GUACAMOLE_SERVICE),
-    (strings.INNEREYE)
+    (strings.GUACAMOLE_SERVICE)
 ]
Repository: microsoft/AzureTRE

Issue:
API app not reporting requests to AppInsights
**Description**
Ensure opencensus reports http requests to app insights.


Discussion:

Resolving patch:
diff --git a/api_app/_version.py b/api_app/_version.py
--- a/api_app/_version.py
+++ b/api_app/_version.py
@@ -1 +1 @@
-__version__ = "0.1.1"
+__version__ = "0.1.3"
diff --git a/api_app/main.py b/api_app/main.py
--- a/api_app/main.py
+++ b/api_app/main.py
@@ -1,7 +1,8 @@
 import logging
+import os
 import uvicorn
 
-from fastapi import FastAPI
+from fastapi import FastAPI, Request
 from fastapi.exceptions import RequestValidationError
 from fastapi_utils.tasks import repeat_every
 from starlette.exceptions import HTTPException
@@ -17,6 +18,16 @@
 from services.logging import disable_unwanted_loggers, initialize_logging
 from service_bus.deployment_status_update import receive_message_and_update_deployment
 
+# Opencensus Azure imports
+from opencensus.ext.azure.trace_exporter import AzureExporter
+from opencensus.trace.attributes_helper import COMMON_ATTRIBUTES
+from opencensus.trace.samplers import ProbabilitySampler
+from opencensus.trace.span import SpanKind
+from opencensus.trace.tracer import Tracer
+
+HTTP_URL = COMMON_ATTRIBUTES['HTTP_URL']
+HTTP_STATUS_CODE = COMMON_ATTRIBUTES['HTTP_STATUS_CODE']
+
 
 def get_application() -> FastAPI:
     application = FastAPI(
@@ -64,5 +75,19 @@ async def update_deployment_status() -> None:
     await receive_message_and_update_deployment(app)
 
 
+@app.middleware("http")
+async def add_process_time_header(request: Request, call_next):
+    tracer = Tracer(exporter=AzureExporter(connection_string=f'InstrumentationKey={os.getenv("APPINSIGHTS_INSTRUMENTATIONKEY")}'), sampler=ProbabilitySampler(1.0))
+    with tracer.span("main") as span:
+        span.span_kind = SpanKind.SERVER
+
+        response = await call_next(request)
+
+        tracer.add_attribute_to_current_span(attribute_key=HTTP_STATUS_CODE, attribute_value=response.status_code)
+        tracer.add_attribute_to_current_span(attribute_key=HTTP_URL, attribute_value=str(request.url))
+
+    return response
+
+
 if __name__ == "__main__":
     uvicorn.run(app, host="0.0.0.0", port=8000)


Test patch:
Repository: microsoft/AzureTRE

Issue:
Health check endpoint should log all the service status as it queries
Currently the `/health` endpoint queries Cosmos / Service Bus / the RP - and returns the statuses. If any are not ok, the response is a 503.

There is currently no way to query that endpoint when the gateway has blocked access - so we at least need it to log the results so we can track back and see what service was down, when.


Discussion:

Resolving patch:
diff --git a/api_app/_version.py b/api_app/_version.py
--- a/api_app/_version.py
+++ b/api_app/_version.py
@@ -1 +1 @@
-__version__ = "0.2.10"
+__version__ = "0.2.11"
diff --git a/api_app/api/routes/health.py b/api_app/api/routes/health.py
--- a/api_app/api/routes/health.py
+++ b/api_app/api/routes/health.py
@@ -3,6 +3,7 @@
 from resources import strings
 from services.health_checker import create_resource_processor_status, create_state_store_status, create_service_bus_status
 from fastapi import HTTPException, status
+import logging
 
 router = APIRouter()
 
@@ -17,5 +18,8 @@ async def health_check() -> HealthCheck:
                 ServiceStatus(service=strings.RESOURCE_PROCESSOR, status=rp_status, message=rp_message)]
     health_check_result = HealthCheck(services=services)
     if cosmos_status == StatusEnum.not_ok or sb_status == StatusEnum.not_ok or rp_status == StatusEnum.not_ok:
+        logging.error(f'Cosmos Status: {cosmos_status}, message: {cosmos_message}')
+        logging.error(f'Service Bus Status: {sb_status}, message: {sb_message}')
+        logging.error(f'Resource Processor Status: {rp_status}, message: {rp_message}')
         raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail=health_check_result.json())
     return health_check_result


Test patch:
Repository: microsoft/AzureTRE

Issue:
WS id can be taken from url
**Describe the bug**
When using the 'second' swagger api (https://<azure_tre_fqdn>/api/workspaces/<workspace_id>/docs), the one intended for the ws owner. The url itself contains the ws id and then it is still required for each api call

If possible to reduce this parameter it will improve usability
**Steps to reproduce**

![image](https://user-images.githubusercontent.com/13205761/159153482-a625994d-f70c-4236-b9ef-b3756575ca49.png)




Discussion:

Resolving patch:
diff --git a/api_app/_version.py b/api_app/_version.py
--- a/api_app/_version.py
+++ b/api_app/_version.py
@@ -1 +1 @@
-__version__ = "0.2.13"
+__version__ = "0.2.14"
diff --git a/api_app/api/routes/api.py b/api_app/api/routes/api.py
--- a/api_app/api/routes/api.py
+++ b/api_app/api/routes/api.py
@@ -113,6 +113,14 @@ async def get_openapi_json(workspace_id: str, request: Request, workspace_repo=D
         }
         openapi_definitions[workspace_id]['components']['securitySchemes']['oauth2']['flows']['authorizationCode']['scopes'] = workspace_scopes
 
+        # Add an example into every workspace_id path parameter so users don't have to cut and paste them in.
+        for route in openapi_definitions[workspace_id]['paths'].values():
+            for verb in route.values():
+                # We now have a list of parameters for each route
+                for parameter in verb['parameters']:
+                    if (parameter['name'] == 'workspace_id'):
+                        parameter['schema']['example'] = workspace_id
+
     return openapi_definitions[workspace_id]
 
 


Test patch:
Repository: microsoft/AzureTRE

Issue:
Release version 0.3
## Description

As a TRE developer 
I want to release current code base as version 0.3
So that people can use a more stable version going forward

## Acceptance criteria

- [ ] All core apps are bumped to 0.3
- [ ] All bundles are bumped to 0.3
- [ ] A tag is created
- [ ] A release is created



Discussion:

Resolving patch:
diff --git a/api_app/_version.py b/api_app/_version.py
--- a/api_app/_version.py
+++ b/api_app/_version.py
@@ -1 +1 @@
-__version__ = "0.2.28"
+__version__ = "0.3.0"


Test patch:
Repository: LibraryOfCongress/concordia

Issue:
Change Docker entrypoint to use gunicorn
* [x] Run WSGI server using gunicorn
* [ ] Do some basic testing with boom / siege / wrk to set reasonable defaults for concurrency



Discussion:

Resolving patch:
diff --git a/concordia/settings_template.py b/concordia/settings_template.py
--- a/concordia/settings_template.py
+++ b/concordia/settings_template.py
@@ -103,15 +103,17 @@
 MIDDLEWARE = [
     "django_prometheus_metrics.middleware.PrometheusBeforeMiddleware",
     "django.middleware.security.SecurityMiddleware",
+    # WhiteNoise serves static files efficiently:
+    "whitenoise.middleware.WhiteNoiseMiddleware",
     "django.contrib.sessions.middleware.SessionMiddleware",
     "django.middleware.common.CommonMiddleware",
     "django.middleware.csrf.CsrfViewMiddleware",
     "django.contrib.auth.middleware.AuthenticationMiddleware",
     "django.contrib.messages.middleware.MessageMiddleware",
     "django.middleware.clickjacking.XFrameOptionsMiddleware",
+    "maintenance_mode.middleware.MaintenanceModeMiddleware",
     # Machina
     "machina.apps.forum_permission.middleware.ForumPermissionMiddleware",
-    "maintenance_mode.middleware.MaintenanceModeMiddleware",
 ]
 
 TEMPLATES = [
@@ -277,15 +279,16 @@
     "REGION": os.getenv("AWS_REGION"),
 }
 
+STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
+WHITENOISE_ROOT = STATIC_ROOT
+
 PASSWORD_RESET_TIMEOUT_DAYS = 1
 ACCOUNT_ACTIVATION_DAYS = 1
 REGISTRATION_OPEN = True  # set to false to temporarily disable registrations
 
-MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
+MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"
 
-MESSAGE_TAGS = {
-    messages.ERROR: 'danger',
-}
+MESSAGE_TAGS = {messages.ERROR: "danger"}
 
 SENTRY_DSN = os.environ.get("SENTRY_DSN", "")
 SENTRY_PUBLIC_DSN = os.environ.get("SENTRY_PUBLIC_DSN", "")


Test patch:
Repository: LibraryOfCongress/concordia

Issue:
Enable Adobe DTM for Analytics (closes #160)
This embeds the code but Adobe’s instructions violate web
performance guidelines and we should review this carefully
to see how much Adobe is affecting site performance.


Discussion:
By review carefully, you mean we should evaluate the performance after I click approve and merge? :)
@rstorey Yes – as in we should make sure we have a way to know how long our pages are taking to load for real visitors
The original instructions didn't mention this but we need to make this conditional based on the environment. Do you want to make it a setting or just have a if check on the CONCORDIA_ENVIRONMENT setting?
Let's use the CONCORDIA_ENVIRONMENT setting. I also have an ENV_NAME setting introduced in the deployment branch which is used to determine which secrets to retrieve.
I'll check in with Leah about the placement of the script. That seems odd. 
@elainekamlley apparently it's Adobe's requirement since they want to be able to run earlier. I think it'll be covered by monitoring it and we can assess strategies for mitigation if it becomes one of the primary slow points.

Resolving patch:
diff --git a/concordia/context_processors.py b/concordia/context_processors.py
--- a/concordia/context_processors.py
+++ b/concordia/context_processors.py
@@ -6,7 +6,10 @@ def system_configuration(request):
     Expose some system configuration to the default template context
     """
 
-    return {"SENTRY_PUBLIC_DSN": getattr(settings, "SENTRY_PUBLIC_DSN", None)}
+    return {
+        "SENTRY_PUBLIC_DSN": getattr(settings, "SENTRY_PUBLIC_DSN", None),
+        "CONCORDIA_ENVIRONMENT": settings.CONCORDIA_ENVIRONMENT,
+    }
 
 
 def site_navigation(request):


Test patch: