Skip to content

Add simulation list to MEModel detail view #377

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

Merged
merged 18 commits into from
May 20, 2025
Merged

Add simulation list to MEModel detail view #377

merged 18 commits into from
May 20, 2025

Conversation

g-bar
Copy link
Contributor

@g-bar g-bar commented May 20, 2025

No description provided.

@g-bar g-bar requested review from bilalesi, tolokoban and pgetta May 20, 2025 06:16
Copy link
Collaborator

@bilalesi bilalesi left a comment

Choose a reason for hiding this comment

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

LGTM, left a comment,
I think this should change after you update the assetLabel in entitycode, so i will approve it after

@g-bar
Copy link
Contributor Author

g-bar commented May 20, 2025

LGTM, left a comment, I think this should change after you update the assetLabel in entitycode, so i will approve it after

This already contains the label changes

See:

single_cell_simulation = 'single_cell_simulation_data',

@bilalesi
Copy link
Collaborator

LGTM, left a comment, I think this should change after you update the assetLabel in entitycode, so i will approve it after

This already contains the label changes

See:

single_cell_simulation = 'single_cell_simulation_data',

for this one, i just remember that the config file name should be in the domain definition in the asset property

export const SingleNeuronSimulation: EntityCoreTypeConfig<ISingleNeuronSimulation> = {
  group: 'simulations',
  title: 'Single Neuron Simulation',
  legacyType: DataType.SingleNeuronSimulation,
  type: EntityTypeEnum.SingleNeuronSimulation,
  slug: EntitySlug.SingleNeuronSimulation,
  isBookmarkable: true,
  api: {
    config: {
      allowedFacets: true,
      allowedParams: 'all',
    },
    query: {
      list: getSingleNeuronSimulations,
      one: getSingleNeuronSimulation,
      create: createSingleNeuronSimulation,
    },
  },
  explore: {
    basePrefix: 'simulate',
    routePrefix: 'simulate',
  },
  asset: {
    extension: 'application/json',
    **configfile: 'single_neuron_simulation_data',**
  },
} as const;

@g-bar
Copy link
Contributor Author

g-bar commented May 20, 2025

LGTM, left a comment, I think this should change after you update the assetLabel in entitycode, so i will approve it after

This already contains the label changes
See:

single_cell_simulation = 'single_cell_simulation_data',

for this one, i just remember that the config file name should be in the domain definition in the asset property

export const SingleNeuronSimulation: EntityCoreTypeConfig<ISingleNeuronSimulation> = {
  group: 'simulations',
  title: 'Single Neuron Simulation',
  legacyType: DataType.SingleNeuronSimulation,
  type: EntityTypeEnum.SingleNeuronSimulation,
  slug: EntitySlug.SingleNeuronSimulation,
  isBookmarkable: true,
  api: {
    config: {
      allowedFacets: true,
      allowedParams: 'all',
    },
    query: {
      list: getSingleNeuronSimulations,
      one: getSingleNeuronSimulation,
      create: createSingleNeuronSimulation,
    },
  },
  explore: {
    basePrefix: 'simulate',
    routePrefix: 'simulate',
  },
  asset: {
    extension: 'application/json',
    **configfile: 'single_neuron_simulation_data',**
  },
} as const;

TBH I don't like those massive config files, kind of over abstraction, and makes it inflexible when some data deviates from the config and makes harder to make changes as devs ( also future devs) need to learn where everything goes. I would've favoured a simpler, more procedural approach.

But will make the change for consistency.

@bilalesi
Copy link
Collaborator

bilalesi commented May 20, 2025

LGTM, left a comment, I think this should change after you update the assetLabel in entitycode, so i will approve it after

This already contains the label changes
See:

single_cell_simulation = 'single_cell_simulation_data',

for this one, i just remember that the config file name should be in the domain definition in the asset property

export const SingleNeuronSimulation: EntityCoreTypeConfig<ISingleNeuronSimulation> = {
  group: 'simulations',
  title: 'Single Neuron Simulation',
  legacyType: DataType.SingleNeuronSimulation,
  type: EntityTypeEnum.SingleNeuronSimulation,
  slug: EntitySlug.SingleNeuronSimulation,
  isBookmarkable: true,
  api: {
    config: {
      allowedFacets: true,
      allowedParams: 'all',
    },
    query: {
      list: getSingleNeuronSimulations,
      one: getSingleNeuronSimulation,
      create: createSingleNeuronSimulation,
    },
  },
  explore: {
    basePrefix: 'simulate',
    routePrefix: 'simulate',
  },
  asset: {
    extension: 'application/json',
    **configfile: 'single_neuron_simulation_data',**
  },
} as const;

TBH I don't like those massive config files, kind of over abstraction, and makes it inflexible when some data deviates from the config and makes harder to make changes as devs ( also future devs) need to learn where everything goes. I would've favoured a simpler, more procedural approach.

But will make the change for consistency.

I get your point about abstraction, but I don’t think this config setup limits flexibility. You can still extend the object directly or add extra logic outside of it in the domain file when needed.
The main goal here is to centralize the setup. Instead of spreading config across different files — which often ends up with things being repeated or out of sync, we keep everything related to the entity in one place: api functions, routing info, data formats, etc. That makes it easier to understand, update, and debug.
this also helped with the migration cleanup. Before, we had config and helper functions dispersed in multiple files, often doing the same thing that caused confusion and bugs, especially when someone changed or deleted the wrong one. Now, there’s a clear structure and a single source of truth, which lowers the risk and keeps the codebase more maintainable.
We may improve it a bit when we have a clear and fundamental fondations after full migration in the upcoming weeks

@g-bar g-bar merged commit 5682604 into simulation May 20, 2025
3 of 4 checks passed
@g-bar g-bar deleted the me-model-sims branch May 20, 2025 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants