Comments (1)
Proceeded with nested serializers.
Example for Task
s:
class TaskSerializer(serializers.ModelSerializer):
training_runs = RunSerializer(many=True)
testing_runs = RunSerializer(many=True)
training_lumisections = LumisectionSerializer(many=True)
testing_lumisections = LumisectionSerializer(many=True)
Returns JSON responses like the following:
{
"id": 5,
"training_runs": [
{
"run_number": 297056,
"date": "2022-04-14T16:43:05.068086Z"
},
{
"run_number": 297225,
"date": "2022-04-14T17:00:58.981281Z"
},
{
"run_number": 297435,
"date": "2022-04-14T16:41:44.732728Z"
}
],
"testing_runs": [
{
"run_number": 297056,
"date": "2022-04-14T16:43:05.068086Z"
}
],
"training_lumisections": [],
"testing_lumisections": [],
"name": "Task 1",
"metadata": "Task 1",
"created": "2022-05-13T16:03:50.348857Z",
"modified": "2022-05-13T16:10:28.242086Z"
}
Example for Prediction
s:
class PredictionSerializer(serializers.ModelSerializer):
strategy = serializers.CharField(source="strategy.model")
run_histograms = RunHistogramSerializer(many=True)
lumisection_histograms_1d = LumisectionHistogram1DSerializer(many=True)
lumisection_histograms_2d = LumisectionHistogram2DSerializer(many=True)
In this example, the task
field is currently not serialized with TaskSerializer
, which would include all the data included in the TaskSerializer
response (see example JSON above), but only keeps the id
of the task.
from mlplayground.
Related Issues (20)
- Fix Bootstrap `data` attributes to match Bootstrap 5.0 naming conventions
- [Data Taking Objects] Add API endpoints for Runs and Lumisections
- Add minimal plots HOT 2
- Re-assign bottom navbar for external data sources
- Add frontend for triggering kedro pipelines with Task(s) as parameters
- [API] Filtering Lumisections by `run` uses the Run's DB id instead of the actual run number
- Add API to certification
- Add CERN login for users
- [Histograms] `Lumisection1DHistogram` parsing does not calculate percentage complete properly
- [Histograms] Refactor data file parsing code
- Use the `Dockerfile` to upload a docker image (to Dockerhub?) to be used in the github workflow
- [Histogram File Manager] Allow multiple paths to be configured for looking for DQMIO files
- Unknown users can sign up for a new account via "Login with CERN" button HOT 3
- Histogram visualizer breaks when histogram does not have x_min and x_max information
- Expose functionality to initiate discovery of DQMIO files
- Histogram manager breaks when histogram name filter contains a forwardslash `/` HOT 1
- Users can access histogram lists without logging in HOT 1
- Add action-tracking information for Discovery/Parsing
- Redesign parsing of lumisection histograms HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mlplayground.