Skip to content

provide planet specific data - #1052

Merged
kingthorin merged 14 commits into
datafaker-net:mainfrom
sergejsvisockis:planet-biometry
Jan 23, 2024
Merged

kingthorin merged 14 commits into
datafaker-net:mainfrom
sergejsvisockis:planet-biometry

Conversation

@sergejsvisockis

@sergejsvisockis sergejsvisockis commented Jan 7, 2024 •

Copy link
Copy Markdown
Contributor

The following Pull Request contains planet-specific metadata.

Outdated method summary

The following methods are in place:

Faker faker = new Faker();
Planet planet = faker.planet();
planet.distanceFromSun();
planet.distanceFromSun(...);
planet.radius();
planet.radius(...);
planet.gravity();
planet.gravity(...);
planet.mass();
planet.mass(...);
planet.lengthOfDay();
planet.lengthOfDay(...);

From @kingthorin:
Data seems to be sourced from:

@what-the-diff

what-the-diff Bot commented Jan 7, 2024

Copy link
Copy Markdown

PR Summary

  • Added Science Module to the System
    The development team has added the net.datafaker.providers.science module into the code structure. This module is meant to manage details related to scientific data.

  • Included the Newly Added Module into the Main Code Flow
    The Faker.java file, which is a key part of our system, has been updated to include import statements for the new science module. In other words, we have integrated this new system component with our existing code.

  • Enhancement to Handle Planet Details
    The Planet class has been added under the science module and various methods have been implemented in it in order to manage planet-related data. To verify the functionality of this new class, a new testing class named PlanetTest has also been introduced.

  • Expansion of Science Module
    Alongside Planet class, ScienceFaker and ScienceProviders classes have been added to our science module. The functionality of these new classes is also being tested with a newly added class ScienceFakerTest.

  • Added Metadata for Planets
    To improve the functionality of the new Planet class, a new file named planet.yml has been added in the en directory. This contains metadata related to various planets ensuring our system can handle and provide meaningful planet-related details.

@codecov-commenter

codecov-commenter commented Jan 7, 2024 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2ad6a52) 92.18% compared to head (f076741) 92.33%.
Report is 11 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1052      +/-   ##
============================================
+ Coverage     92.18%   92.33%   +0.14%     
- Complexity     2762     2819      +57     
============================================
  Files           291      292       +1     
  Lines          5543     5607      +64     
  Branches        600      599       -1     
============================================
+ Hits           5110     5177      +67     
  Misses          276      276              
+ Partials        157      154       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread README.md Resolved
Comment thread src/main/java/module-info.java Resolved
Comment thread src/main/resources/en/planet.yml Resolved
@sergejsvisockis sergejsvisockis changed the title provide planet specific metadata WiP: provide planet specific metadata Jan 7, 2024
@sergejsvisockis sergejsvisockis changed the title WiP: provide planet specific metadata provide planet specific metadata Jan 7, 2024
@sergejsvisockis
sergejsvisockis marked this pull request as draft January 7, 2024 22:22
@kingthorin

Copy link
Copy Markdown
Collaborator

I’d like to suggest keeping Pluto in the data and enum. By default you can exclude it, but providing a faker that accepts a boolean indicating its inclusion/exclusion would be a brilliant move in my opinion.

Also you could include some kind of “classification” method…dwarf, rocky, gas, gas giant 🤷‍♂️ (I dunno if those actually all fall in the same category astronomically speaking but hopefully you get the vision 😉)

@kingthorin

Copy link
Copy Markdown
Collaborator

Needs a spotlessapply but I forget the command off the top of my head. I'll try to get it for you later.

You could try:
./mvnw spotless:apply

@snuyanzin

Copy link
Copy Markdown
Collaborator

it's written in logs

Run 'mvn spotless:apply' to fix these violations.

https://github.com/datafaker-net/datafaker/actions/runs/7465141979/job/20313659562?pr=1052#step:4:65

@sergejsvisockis

sergejsvisockis commented Jan 9, 2024 •

Copy link
Copy Markdown
Contributor Author

Needs a spotlessapply but I forget the command off the top of my head. I'll try to get it for you later.

You could try: ./mvnw spotless:apply

Definitely! This merge request is still a draft. I'll make it properly as soon as it's ready. Prior to that, I would prefer pushing here as regular till marked as non-draft.

@sergejsvisockis

sergejsvisockis commented Jan 9, 2024 •

Copy link
Copy Markdown
Contributor Author

I’d like to suggest keeping Pluto in the data and enum. By default you can exclude it, but providing a faker that accepts a boolean indicating its inclusion/exclusion would be a brilliant move in my opinion.

Also you could include some kind of “classification” method…dwarf, rocky, gas, gas giant 🤷‍♂️ (I dunno if those actually all fall in the same category astronomically speaking but hopefully you get the vision 😉)

Thanks a lot for the idea! Agree that it makes sense to add that Neptune, besides there are a bunch of other planets
aka "non-planets" astronomically along with classification for each one.

What concerns being able to exclude - If I were a user then this Faker would rather over-complicate things. Public API present at the moment can get any info on a particular planet by its name. See - public String symbol(PlanetName planetName) for instance. As it is for now it's up to the user to decide which data to get.

When it comes to the random faker - public String symbol() then it just returns a random value no matter what.

I would suggest skipping this part with exclusion and just adding these "non-planets" just like any other planet present out there. Still, user can decide what they want to get depending on their intentions. What do you think?

@kingthorin

Copy link
Copy Markdown
Collaborator

Agreed. Keep the "full" list and users can always choose to ignore pluto etc in their own code.

We can always re-visit in the future if there's feedback.

@sergejsvisockis

sergejsvisockis commented Jan 10, 2024 •

Copy link
Copy Markdown
Contributor Author

Hi all,

Apologies, I am extremely preoccupied with my full-time work-related matters and would like to take my free time for other things non-coding related.
Therefore, I am cancelling this feature and closing this Pull Request.

On this occasion, if you do consider that this improvement has some degree of priority then feel free to pick it up out of this point and move it forward.

Thanks!

Cheers!

@bodiam bodiam reopened this Jan 10, 2024
@bodiam

bodiam commented Jan 10, 2024

Copy link
Copy Markdown
Contributor

Hi @sergejsvisockis , no worries. I really like the work you've done here, and I don't want to let it go to waste, so let's keep the PR open if you don't mind, and one of us will complete the PR if you don't mind?

@sergejsvisockis

Copy link
Copy Markdown
Contributor Author

Hi @sergejsvisockis , no worries. I really like the work you've done here, and I don't want to let it go to waste, so let's keep the PR open if you don't mind, and one of us will complete the PR if you don't mind?

Hi @bodiam, Sure, I am totally fine to keep it open till someone (including myself) can allocate time for this upon availability at any point in time in the future.

@kingthorin

kingthorin commented Jan 10, 2024 •

Copy link
Copy Markdown
Collaborator

Okay that should have spotless and tests dealt with. I'll loop back around to the pluto inclusion item in the next few days weeks.

@kingthorin

kingthorin commented Jan 13, 2024 •

Copy link
Copy Markdown
Collaborator

From original commit:

 length_of_day:
        pluto:
        - "153 h"
mass:
        pluto:
        - "1.30900 × 1022 kg"
gravity:
        pluto:
        - "0.62 m/s²"
radius:
        pluto:
        - "1,188.3 km"
 distance_from_sun:
        pluto:
        - "3.7 billion miles"

@sergejsvisockis sergejsvisockis changed the title provide planet specific metadata provide planet specific biometry Jan 16, 2024
@sergejsvisockis sergejsvisockis changed the title provide planet specific biometry provide planet specific biometrics Jan 16, 2024
@sergejsvisockis sergejsvisockis changed the title provide planet specific biometrics provide planet specific data Jan 17, 2024
@kingthorin
kingthorin marked this pull request as ready for review January 22, 2024 01:02
@kingthorin

Copy link
Copy Markdown
Collaborator

Pluto added and good to go as far as I'm concerned.

@sergejsvisockis

Copy link
Copy Markdown
Contributor Author

It looks good from the domain and implementation standpoint and as an initial author of this feature, I approve this Pull Request.

@kingthorin

Copy link
Copy Markdown
Collaborator

Thanks @sergejsvisockis

@sergejsvisockis

sergejsvisockis commented Jan 22, 2024 •

Copy link
Copy Markdown
Contributor Author

Thanks @sergejsvisockis

Thank you for finishing this one too!

@kingthorin

Copy link
Copy Markdown
Collaborator

Fixed

@kingthorin
kingthorin merged commit 73ae126 into datafaker-net:main Jan 23, 2024
@sergejsvisockis
sergejsvisockis deleted the planet-biometry branch January 23, 2024 21:34
@sergejsvisockis
sergejsvisockis restored the planet-biometry branch January 23, 2024 21:34
@sergejsvisockis
sergejsvisockis deleted the planet-biometry branch January 23, 2024 21:34
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.

5 participants