Skip to content
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

Test Cases for UE Generation Handler #11

Merged
merged 34 commits into from
Oct 1, 2024
Merged

Test Cases for UE Generation Handler #11

merged 34 commits into from
Oct 1, 2024

Conversation

WaterMenon09
Copy link
Contributor

Introduction

This PR introduces a suite of test cases for the UE Generation Handler to ensure the accuracy and reliability of the mobility data generation process. The tests cover various aspects including the conversion of XY coordinates to geographic coordinates, the integrity of the DataFrame structure, and the consistency of data across multiple batches and ticks.

Test Details

  • Test Conversion Accuracy: Validates that the XY to longitude/latitude conversion aligns with expected geographical mappings.
  • DataFrame Structure Verification: Ensures that the DataFrame contains the correct columns (mock_ue_id, longitude, latitude, tick) and that data types are appropriately assigned.
  • Batch and Tick Consistency: Checks that data is consistent across different batches and ticks, ensuring no data leakage or misalignment occurs.

Copy link

linux-foundation-easycla bot commented Sep 17, 2024

CLA Not Signed

Copy link
Collaborator

@paulvarkey paulvarkey left a comment

Choose a reason for hiding this comment

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

  1. Feel free to add CLI command in the description that specifies how to run the tests
  2. Add docstrings in each test (your PR description is quite nice -- those same comments may appear as docstrings here)

Comment on lines 72 to 75
'''
if __name__ == '__main__':
unittest.main()
'''
Copy link
Collaborator

Choose a reason for hiding this comment

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

may delete

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed the redundant comments, added the docstring and added the CLI code to run in the docstring under
"How To Run"

@@ -0,0 +1,75 @@
import unittest
Copy link
Collaborator

Choose a reason for hiding this comment

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

rename file as test_ue_tracks_generation_helper.py

Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed the file

Copy link
Collaborator

@paulvarkey paulvarkey left a comment

Choose a reason for hiding this comment

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

Approved -- please add comments from PR description as docstrings for individual tests (or, main class) as appropriate.

Comment on lines 11 to 33
"""
Unit tests for the UETracksGenerationHelper class.

This test suite validates key functionalities of the UETracksGenerationHelper
class, which handles mobility data generation for user equipment (UE).
The tests focus on verifying:

- Correct retrieval of simulation parameters such as simulation ID, number
of ticks, and batches.
- Proper generation of output file prefixes.
- Accurate calculation of UE class distributions (counts and velocities).
- Correct geographic boundary values for latitude and longitude.
- Accuracy of Gauss-Markov model parameters, specifically the alpha value.

Mock data is used to simulate job configurations and expected outputs.

How to Run:
------------
To run these tests, execute the following command in your terminal:
```
python3 -m unittest radp/digital_twin/mobility/tests/test_ue_tracks_generation_helper.py
```
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

can be moved as docstring for the class

@WaterMenon09
Copy link
Contributor Author

made the necessary changes and added short discrete comments for every function

Merge branch 'ue-generation-handler' into Test_UEGeneration_Handler

- Integrated new UE generation features from 'ue-generation-handler'.
- Updated existing tests to accommodate new functionalities.
- Ensured compatibility with current implementations.
@paulvarkey paulvarkey merged commit 4b5cd5a into lf-connectivity:main Oct 1, 2024
2 of 3 checks passed
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.

3 participants